Skip to content

Commit c38c302

Browse files
committed
address comments
Signed-off-by: Yupeng Fu <yupeng@uber.com>
1 parent a174570 commit c38c302

File tree

7 files changed

+21
-29
lines changed

7 files changed

+21
-29
lines changed

plugins/ingestion-kafka/src/internalClusterTest/java/org/opensearch/plugin/kafka/IngestFromKafkaIT.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* Integration test for Kafka ingestion
4747
*/
48-
@ThreadLeakLingering(linger = 5000) // wait for container pull thread to die
48+
@ThreadLeakLingering(linger = 15000) // wait for container pull thread to die
4949
public class IngestFromKafkaIT extends OpenSearchIntegTestCase {
5050
static final String topicName = "test";
5151

server/src/main/java/org/opensearch/cluster/metadata/IndexMetadata.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,7 @@ public void validate(final String value, final Map<Setting<?>, Object> settings)
666666
// TODO: validate this with the ingestion source params
667667
}
668668
},
669-
Property.IndexScope,
670-
Property.Dynamic
669+
Property.IndexScope
671670
);
672671

673672
/**
@@ -704,11 +703,6 @@ public void validate(final String value, final Map<Setting<?>, Object> settings)
704703
}, Property.IndexScope)
705704
);
706705

707-
/**
708-
* Used to specify the params for the ingestion index.
709-
*/
710-
public static final String SETTING_INGESTION_SOURCE_PARAMS = "index.ingestion_source.params";
711-
712706
/**
713707
* an internal index format description, allowing us to find out if this index is upgraded or needs upgrading
714708
*/

server/src/main/java/org/opensearch/cluster/metadata/IngestionSource.java

-4
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ public Map<String, Object> params() {
4040
return params;
4141
}
4242

43-
public void params(Map<String, Object> params) {
44-
this.params = params;
45-
}
46-
4743
@Override
4844
public boolean equals(Object o) {
4945
if (this == o) return true;

server/src/main/java/org/opensearch/index/engine/IngestionEngine.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
import java.util.function.BiFunction;
8181
import java.util.function.UnaryOperator;
8282

83-
import static org.opensearch.index.engine.NoOpEngine.EMPTY_TRANSLOG_SNAPSHOT;
83+
import static org.opensearch.index.translog.Translog.EMPTY_TRANSLOG_SNAPSHOT;
8484

8585
/**
8686
* IngestionEngine is an engine that ingests data from a stream source.

server/src/main/java/org/opensearch/index/engine/NoOpEngine.java

+2-15
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
import java.util.Map;
5959
import java.util.function.Function;
6060

61+
import static org.opensearch.index.translog.Translog.EMPTY_TRANSLOG_SNAPSHOT;
62+
6163
/**
6264
* NoOpEngine is an engine implementation that does nothing but the bare minimum
6365
* required in order to have an engine. All attempts to do something (search,
@@ -72,21 +74,6 @@ public final class NoOpEngine extends ReadOnlyEngine {
7274
private final SegmentsStats segmentsStats;
7375
private final DocsStats docsStats;
7476

75-
static final Translog.Snapshot EMPTY_TRANSLOG_SNAPSHOT = new Translog.Snapshot() {
76-
@Override
77-
public void close() {}
78-
79-
@Override
80-
public int totalOperations() {
81-
return 0;
82-
}
83-
84-
@Override
85-
public Translog.Operation next() {
86-
return null;
87-
}
88-
};
89-
9077
public NoOpEngine(EngineConfig config) {
9178
super(config, null, null, true, Function.identity(), true);
9279
this.segmentsStats = new SegmentsStats();

server/src/main/java/org/opensearch/index/engine/ReadOnlyEngine.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
import java.util.function.BiFunction;
6767
import java.util.function.Function;
6868

69-
import static org.opensearch.index.engine.NoOpEngine.EMPTY_TRANSLOG_SNAPSHOT;
69+
import static org.opensearch.index.translog.Translog.EMPTY_TRANSLOG_SNAPSHOT;
7070

7171
/**
7272
* A basic read-only engine that allows switching a shard to be true read-only temporarily or permanently.

server/src/main/java/org/opensearch/index/translog/Translog.java

+15
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,21 @@ public int hashCode() {
959959
}
960960
}
961961

962+
public static final Translog.Snapshot EMPTY_TRANSLOG_SNAPSHOT = new Translog.Snapshot() {
963+
@Override
964+
public void close() {}
965+
966+
@Override
967+
public int totalOperations() {
968+
return 0;
969+
}
970+
971+
@Override
972+
public Translog.Operation next() {
973+
return null;
974+
}
975+
};
976+
962977
/**
963978
* A snapshot of the transaction log, allows to iterate over all the transaction log operations.
964979
*

0 commit comments

Comments
 (0)