Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Yupeng Fu <[email protected]>
  • Loading branch information
yupeng9 committed Jan 24, 2025
1 parent 4e0a4fa commit a756d18
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,7 @@ public void validate(final String value, final Map<Setting<?>, Object> settings)
// TODO: validate this with the ingestion source params
}
},
Property.IndexScope,
Property.Dynamic
Property.IndexScope
);

/**
Expand Down Expand Up @@ -693,11 +692,6 @@ public void validate(final String value, final Map<Setting<?>, Object> settings)
}, Property.IndexScope)
);

/**
* Used to specify the params for the ingestion index.
*/
public static final String SETTING_INGESTION_SOURCE_PARAMS = "index.ingestion_source.params";

/**
* an internal index format description, allowing us to find out if this index is upgraded or needs upgrading
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ public Map<String, Object> params() {
return params;
}

public void params(Map<String, Object> params) {
this.params = params;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
import java.util.function.BiFunction;
import java.util.function.UnaryOperator;

import static org.opensearch.index.engine.NoOpEngine.EMPTY_TRANSLOG_SNAPSHOT;
import static org.opensearch.index.translog.Translog.EMPTY_TRANSLOG_SNAPSHOT;

/**
* IngestionEngine is an engine that ingests data from a stream source.
Expand Down
17 changes: 2 additions & 15 deletions server/src/main/java/org/opensearch/index/engine/NoOpEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
import java.util.Map;
import java.util.function.Function;

import static org.opensearch.index.translog.Translog.EMPTY_TRANSLOG_SNAPSHOT;

/**
* NoOpEngine is an engine implementation that does nothing but the bare minimum
* required in order to have an engine. All attempts to do something (search,
Expand All @@ -72,21 +74,6 @@ public final class NoOpEngine extends ReadOnlyEngine {
private final SegmentsStats segmentsStats;
private final DocsStats docsStats;

static final Translog.Snapshot EMPTY_TRANSLOG_SNAPSHOT = new Translog.Snapshot() {
@Override
public void close() {}

@Override
public int totalOperations() {
return 0;
}

@Override
public Translog.Operation next() {
return null;
}
};

public NoOpEngine(EngineConfig config) {
super(config, null, null, true, Function.identity(), true);
this.segmentsStats = new SegmentsStats();
Expand Down
15 changes: 15 additions & 0 deletions server/src/main/java/org/opensearch/index/translog/Translog.java
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,21 @@ public int hashCode() {
}
}

public static final Translog.Snapshot EMPTY_TRANSLOG_SNAPSHOT = new Translog.Snapshot() {
@Override
public void close() {}

@Override
public int totalOperations() {
return 0;
}

@Override
public Translog.Operation next() {
return null;
}
};

/**
* A snapshot of the transaction log, allows to iterate over all the transaction log operations.
*
Expand Down

0 comments on commit a756d18

Please sign in to comment.