Skip to content

@Override annotation should be used where necessary #723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ language: java
jdk:
- oraclejdk8

script: ./bin/travis/run-tests.sh
before_script:
- echo "MAVEN_OPTS='-Xmx4096m -Xms4096m'" > ~/.mavenrc

script: travis_wait ./bin/travis/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public class SinkMetric extends ElasticsearchIngestMetric {

@Override
public SinkMetric start() {
super.start();
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ protected void map(K k, V v, IndexableObject current) throws IOException {
* @return this value listener
* @throws java.io.IOException if this method fails
*/
@Override
public KeyValueStreamListener<K, V> end() throws IOException {
if (prev != null) {
prev.source(current.source());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ public SinkKeyValueStreamListener<K, V> output(Sink output) {
return this;
}

@Override
public SinkKeyValueStreamListener<K, V> shouldIgnoreNull(boolean shouldIgnoreNull) {
super.shouldIgnoreNull(shouldIgnoreNull);
return this;
}

@Override
public SinkKeyValueStreamListener<K, V> shouldDetectGeo(boolean shouldDetectGeo) {
super.shouldDetectGeo(shouldDetectGeo);
return this;
}

@Override
public SinkKeyValueStreamListener<K, V> shouldDetectJson(boolean shouldDetectJson) {
super.shouldDetectJson(shouldDetectJson);
return this;
Expand All @@ -54,6 +57,7 @@ public SinkKeyValueStreamListener<K, V> shouldDetectJson(boolean shouldDetectJso
* @return this value listener
* @throws java.io.IOException if this method fails
*/
@Override
public SinkKeyValueStreamListener<K, V> end(IndexableObject object) throws IOException {
if (object.isEmpty()) {
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public interface JDBCSource<C extends Context> extends Source<C> {
*
* @return a new source instance
*/
@Override
JDBCSource<C> newInstance();

/**
Expand All @@ -50,6 +51,7 @@ public interface JDBCSource<C extends Context> extends Source<C> {
* @param context the context
* @return this source
*/
@Override
JDBCSource<C> setContext(C context);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ protected void prepareContext(S source, Sink sink) throws IOException {

private final static MetricsLogger metricsLogger = new MetricsLogger();

@Override
public void log() {
try {
if (source != null) {
Expand All @@ -385,6 +386,7 @@ public void log() {
}

class MetricsThread extends Thread {
@Override
public void run() {
log();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ public StandardSource<C> setTimeZone(TimeZone timezone) {
return this;
}

@Override
public StandardSource<C> setAutoCommit(boolean autocommit) {
this.autocommit = autocommit;
return this;
Expand All @@ -227,6 +228,7 @@ public boolean getAutoCommit() {
return autocommit;
}

@Override
public StandardSource<C> setFetchSize(int fetchSize) {
this.fetchSize = fetchSize;
return this;
Expand All @@ -236,6 +238,7 @@ public int getFetchSize() {
return fetchSize;
}

@Override
public StandardSource<C> setMaxRows(int maxRows) {
this.maxRows = maxRows;
return this;
Expand All @@ -245,6 +248,7 @@ public int getMaxRows() {
return maxRows;
}

@Override
public StandardSource<C> setRetries(int retries) {
this.retries = retries;
return this;
Expand All @@ -254,6 +258,7 @@ public int getRetries() {
return retries;
}

@Override
public StandardSource<C> setMaxRetryWait(TimeValue maxretrywait) {
this.maxretrywait = maxretrywait;
return this;
Expand All @@ -263,6 +268,7 @@ public TimeValue getMaxRetryWait() {
return maxretrywait;
}

@Override
public StandardSource<C> setRounding(String rounding) {
if ("ceiling".equalsIgnoreCase(rounding)) {
this.rounding = BigDecimal.ROUND_CEILING;
Expand All @@ -288,6 +294,7 @@ public int getRounding() {
return rounding;
}

@Override
public StandardSource<C> setScale(int scale) {
this.scale = scale;
return this;
Expand All @@ -297,6 +304,7 @@ public int getScale() {
return scale;
}

@Override
public StandardSource<C> setResultSetType(String resultSetType) {
this.resultSetType = resultSetType;
return this;
Expand All @@ -306,6 +314,7 @@ public String getResultSetType() {
return resultSetType;
}

@Override
public StandardSource<C> setResultSetConcurrency(String resultSetConcurrency) {
this.resultSetConcurrency = resultSetConcurrency;
return this;
Expand All @@ -315,6 +324,7 @@ public String getResultSetConcurrency() {
return resultSetConcurrency;
}

@Override
public StandardSource<C> shouldIgnoreNull(boolean shouldIgnoreNull) {
this.shouldIgnoreNull = shouldIgnoreNull;
return this;
Expand All @@ -324,6 +334,7 @@ public boolean shouldIgnoreNull() {
return shouldIgnoreNull;
}

@Override
public StandardSource<C> shouldDetectGeo(boolean shouldDetectGeo) {
this.shouldDetectGeo = shouldDetectGeo;
return this;
Expand All @@ -333,6 +344,7 @@ public boolean shouldDetectGeo() {
return shouldDetectGeo;
}

@Override
public StandardSource<C> shouldDetectJson(boolean shouldDetectJson) {
this.shouldDetectJson = shouldDetectJson;
return this;
Expand All @@ -342,6 +354,7 @@ public boolean shouldDetectJson() {
return shouldDetectJson;
}

@Override
public StandardSource<C> shouldPrepareResultSetMetadata(boolean shouldPrepareResultSetMetadata) {
this.shouldPrepareResultSetMetadata = shouldPrepareResultSetMetadata;
return this;
Expand All @@ -351,6 +364,7 @@ public boolean shouldPrepareResultSetMetadata() {
return shouldPrepareResultSetMetadata;
}

@Override
public StandardSource<C> shouldPrepareDatabaseMetadata(boolean shouldPrepareDatabaseMetadata) {
this.shouldPrepareDatabaseMetadata = shouldPrepareDatabaseMetadata;
return this;
Expand Down Expand Up @@ -387,6 +401,7 @@ public long getLastRowCount() {
return lastRowCount;
}

@Override
public StandardSource<C> setColumnNameMap(Map<String, Object> columnNameMap) {
this.columnNameMap = columnNameMap;
return this;
Expand All @@ -405,6 +420,7 @@ public Map<String, Object> getLastRow() {
return lastRow;
}

@Override
public StandardSource<C> setStatements(List<SQLCommand> sql) {
this.sql = sql;
return this;
Expand All @@ -423,6 +439,7 @@ public boolean isTimestampDiffSupported() {
return isTimestampDiffSupported;
}

@Override
public StandardSource<C> setQueryTimeout(int queryTimeout) {
this.queryTimeout = queryTimeout;
return this;
Expand All @@ -432,6 +449,7 @@ public int getQueryTimeout() {
return queryTimeout;
}

@Override
public StandardSource<C> setConnectionProperties(Map<String, Object> connectionProperties) {
this.connectionProperties = connectionProperties;
return this;
Expand All @@ -441,6 +459,7 @@ public Map<String, Object> getConnectionProperties() {
return connectionProperties;
}

@Override
public StandardSource<C> shouldTreatBinaryAsString(boolean shouldTreatBinaryAsString) {
this.shouldTreatBinaryAsString = shouldTreatBinaryAsString;
return this;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/xbib/pipeline/AbstractPipeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public Pipeline<R> setQueue(BlockingQueue<R> queue) {
return this;
}

@Override
public BlockingQueue<R> getQueue() {
return queue;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/xbib/tools/JDBCImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public boolean waitFor(Context.State state, long millis) throws InterruptedExcep

public Thread shutdownHook() {
return new Thread() {
@Override
public void run() {
try {
shutdown();
Expand All @@ -169,6 +170,7 @@ public void run() {
};
}

@Override
public synchronized void shutdown() throws Exception {
if (closed) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public StringKeyValueStreamListener output(Sink output) {
* @return this value listener
* @throws IOException
*/
@Override
public StringKeyValueStreamListener end(IndexableObject object) throws IOException {
if (object.isEmpty()) {
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ private void testColumnStrategy(MockSink sink, String resource, String sql, Prod
assertEquals(sink.data().size(), expectedHits);
}

@Override
protected ColumnContext createContext(String resource) throws IOException {
Settings settings = createSettings(resource);
ColumnContext context = newContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public StandardContext newContext() {
return new StandardContext();
}

@Override
protected void perform(String resource) throws Exception {
// perform a single step
logger.info("before execution, resetting counter");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ private JDBCImporter createImporter(String resource) throws Exception {
importer.setContext(context);
// dispatch in new thread
new Thread() {
@Override
public void run() {
importer.run(true);
}
Expand Down