Projects >> elasticsearch-jdbc >>1c7aea51ebdf3b3c16318473604fa86db091688b

Chunk
Conflicting content
    @Override
    public boolean equals(Object o) {
<<<<<<< HEAD:src/main/java/org/xbib/elasticsearch/plugin/jdbc/util/PlainIndexableObject.java
        if (!(o instanceof IndexableObject)) {
            return false;
        }
        IndexableObject indexableObject = (IndexableObject) o;
=======
        if (!(o instanceof  IndexableObject)) {
            return false;
        }
        IndexableObject indexableObject = (IndexableObject)o;
>>>>>>> 384d79aa54dc8b08b79075868391fd0f5e6136d9:src/main/java/org/xbib/elasticsearch/common/util/PlainIndexableObject.java
        return new EqualsBuilder()
                .append(optype(), indexableObject.optype())
                .append(index(), indexableObject.index())
Solution content
    @Override
    public boolean equals(Object o) {
        if (!(o instanceof  IndexableObject)) {
            return false;
        }
        IndexableObject indexableObject = (IndexableObject)o;
        return new EqualsBuilder()
                .append(optype(), indexableObject.optype())
                .append(index(), indexableObject.index())
File
PlainIndexableObject.java
Developer's decision
Version 1
Kind of conflict
Cast expression
If statement
Variable
Chunk
Conflicting content
    TimeZone getTimeZone();

    /**
     * Suspend river source
     *
     * @throws Exception
     */
     * Set the timezone for setTimestamp() calls with calendar object.
     *
     * @param timeZone the time zone
<<<<<<< HEAD:src/main/java/org/xbib/elasticsearch/river/jdbc/RiverSource.java
     * @return this river source
     */
    RiverSource setTimeZone(TimeZone timeZone);

    /**
     * Get the current timezone of this river source for the JDBC setTimestamp() call
     *
     * @return the time zone
     */

}
    void suspend() throws Exception;

    /**
     * Resume river source
     *
     * @throws Exception
     */
    void resume() throws Exception;

    /**
     * Release resources of source
     *
     * @throws Exception
     */
    void release() throws Exception;

    /**
     * Shutdown source
     *
     * @throws IOException
     */
    void shutdown() throws IOException, SQLException;
=======
     * @return this source
     */
    JDBCSource setTimeZone(TimeZone timeZone);
>>>>>>> 384d79aa54dc8b08b79075868391fd0f5e6136d9:src/main/java/org/xbib/elasticsearch/jdbc/strategy/JDBCSource.java
Solution content
     * Set the timezone for setTimestamp() calls with calendar object.
     *
     * @param timeZone the time zone
     * @return this source
     */
    JDBCSource setTimeZone(TimeZone timeZone);

}
File
JDBCSource.java
Developer's decision
Version 2
Kind of conflict
Comment
Method interface
Chunk
Conflicting content
     * @return this sink
     */
     * @param context the context
<<<<<<< HEAD:src/main/java/org/xbib/elasticsearch/river/jdbc/RiverMouth.java
    RiverMouth setRiverContext(RC context);

    /**
     * Set ingest factory
     *
     * @param ingestFactory the ingest factory
     * @return this river mouth
     */
    RiverMouth setIngestFactory(IngestFactory ingestFactory) throws IOException;

    /**
     * Get the metrics of this river mouth
     *
     * @return this river mouth
     */
    Metric getMetric();
=======
    Sink setContext(C context);
>>>>>>> 384d79aa54dc8b08b79075868391fd0f5e6136d9:src/main/java/org/xbib/elasticsearch/jdbc/strategy/Sink.java

    /**
     * Set index settings
Solution content
     * @param context the context
     * @return this sink
     */
    Sink setContext(C context);

    /**
     * Set index settings
File
Sink.java
Developer's decision
Version 2
Kind of conflict
Comment
Method interface
Chunk
Conflicting content
    }

    @Override
<<<<<<< HEAD:src/main/java/org/xbib/elasticsearch/river/jdbc/strategy/simple/SimpleRiverMouth.java
    public SimpleRiverMouth setIngestFactory(IngestFactory ingestFactory) throws IOException {
        this.ingestFactory = ingestFactory;
        this.ingest = ingestFactory.create();
        this.metric = ingest.getMetric();
=======
    public StandardSink setMetric(Metric metric) {
        this.metric = metric;
>>>>>>> 384d79aa54dc8b08b79075868391fd0f5e6136d9:src/main/java/org/xbib/elasticsearch/jdbc/strategy/standard/StandardSink.java
        return this;
    }
Solution content
    }

    @Override
    public StandardSink setMetric(Metric metric) {
        this.metric = metric;
        return this;
    }
File
StandardSink.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Method signature
Chunk
Conflicting content
    @Override
    public void afterFetch() throws Exception {
<<<<<<< HEAD:src/main/java/org/xbib/elasticsearch/river/jdbc/strategy/simple/SimpleRiverSource.java
        context.setLastEndDate(new DateTime().getMillis());
        release();
    }

    @Override
    public void release() throws SQLException {
=======
        shutdown();
    }

    @Override
    public void shutdown() {
        logger.debug("shutdown");
>>>>>>> 384d79aa54dc8b08b79075868391fd0f5e6136d9:src/main/java/org/xbib/elasticsearch/jdbc/strategy/standard/StandardSource.java
        closeReading();
        logger.debug("read connection closed");
        readConnection = null;
Solution content
    public void shutdown() {
        logger.debug("shutdown");

    @Override
        closeReading();
        logger.debug("read connection closed");
    public void afterFetch() throws Exception {
        shutdown();
    }

    @Override
        readConnection = null;
File
StandardSource.java
Developer's decision
Version 2
Kind of conflict
Annotation
Method invocation
Method signature
Chunk
Conflicting content
                    }
            if ("$now".equals(s)) {
                Timestamp t = new Timestamp(new DateTime().getMillis());
                statement.setTimestamp(i, t, calendar);
<<<<<<< HEAD:src/main/java/org/xbib/elasticsearch/river/jdbc/strategy/simple/SimpleRiverSource.java
            } else if ("$job".equals(s)) {
                logger.trace("setting $job to {}", context.getRiverState().getCounter());
                statement.setInt(i, context.getRiverState().getCounter());
            } else if ("$count".equals(s)) {
                logger.trace("setting $count to {}", context.getLastRowCount());
                statement.setLong(i, context.getLastRowCount());
            } else if ("$last.sql.start".equals(s)) {
                if (context.getLastExecutionStartDate() == 0L) {
                    Timestamp t = new Timestamp(context.getRiverState() != null ?
                            context.getRiverState().getLastExecutionStartDate() : new DateTime().getMillis());
                    context.setLastExecutionStartDate(t.getTime());
                }
                statement.setTimestamp(i, new Timestamp(context.getLastExecutionStartDate()), calendar);
            } else if ("$last.sql.end".equals(s)) {
                if (context.getLastExecutionEndDate() == 0L) {
                    Timestamp t = new Timestamp(context.getRiverState() != null ?
                            context.getRiverState().getLastExecutionEndDate() : new DateTime().getMillis());
                    context.setLastExecutionEndDate(t.getTime());
                }
                statement.setTimestamp(i, new Timestamp(context.getLastExecutionEndDate()), calendar);
            } else if ("$last.sql.sequence.start".equals(s)) {
                if (context.getLastStartDate() == 0L) {
                    Timestamp t = new Timestamp(context.getRiverState() != null ?
                            context.getRiverState().getLastStartDate() : new DateTime().getMillis());
                    context.setLastStartDate(t.getTime());
                }
                statement.setTimestamp(i, new Timestamp(context.getLastStartDate()), calendar);
            } else if ("$last.sql.sequence.end".equals(s)) {
                if (context.getLastEndDate() == 0L) {
                    Timestamp t = new Timestamp(context.getRiverState() != null ?
                            context.getRiverState().getLastEndDate() : new DateTime().getMillis());
                    context.setLastEndDate(t.getTime());
                }
                statement.setTimestamp(i, new Timestamp(context.getLastEndDate()), calendar);
            } else if ("$river.name".equals(s)) {
                String name = context.getRiverState().getName();
                statement.setString(i, name);
            } else if ("$river.state.started".equals(s)) {
                Timestamp riverStarted = new Timestamp(context.getRiverState() != null ?
                        context.getRiverState().getStarted().getMillis() : new DateTime().getMillis());
                statement.setTimestamp(i, riverStarted, calendar);
            } else if ("$river.state.last_active_begin".equals(s)) {
                Timestamp timestamp = new Timestamp(context.getRiverState() != null && context.getRiverState().getLastActiveBegin() != null ?
                        context.getRiverState().getLastActiveBegin().getMillis() : new DateTime().getMillis());
                statement.setTimestamp(i, timestamp, calendar);
            } else if ("$river.state.last_active_end".equals(s)) {
                Timestamp timestamp = new Timestamp(context.getRiverState() != null && context.getRiverState().getLastActiveEnd() != null ?
                        context.getRiverState().getLastActiveEnd().getMillis() : new DateTime().getMillis());
                statement.setTimestamp(i, timestamp, calendar);
            } else if ("$river.state.counter".equals(s)) {
                Integer counter = context.getRiverState().getCounter();
                if (counter != null) {
                    statement.setInt(i, counter);
                }
            } else if (context.shouldPrepareDatabaseMetadata()) {
                for (String k : context.getLastDatabaseMetadata().keySet()) {
=======
            } else if ("$state".equals(s)) {
                String state = context.getState().name();
                statement.setString(i, state);
            } else if ("$metrics.counter".equals(s) || "$job".equals(s)) { // $job for legacy support
                Long counter = metric != null ? metric.getCounter() : -0L;
                statement.setLong(i, counter);
            } else if ("$lastrowcount".equals(s)) {
                statement.setLong(i, getLastRowCount());
            } else if ("$lastexceptiondate".equals(s)) {
                DateTime dateTime = context.getDateOfThrowable();
                statement.setTimestamp(i, dateTime != null ? new Timestamp(dateTime.getMillis()) : null);
            } else if ("$lastexception".equals(s)) {
                statement.setString(i, ExceptionFormatter.format(context.getThrowable()));
            } else if ("$metrics.lastexecutionstart".equals(s)) {
                DateTime dateTime = metric != null ? metric.getLastExecutionStart() : null;
                statement.setTimestamp(i, dateTime != null ? new Timestamp(dateTime.getMillis()) : null);
            } else if ("$metrics.lastexecutionend".equals(s)) {
                DateTime dateTime = metric != null ? metric.getLastExecutionEnd() : null;
                statement.setTimestamp(i, dateTime != null ? new Timestamp(dateTime.getMillis()) : null);
            } else if ("$metrics.totalrows".equals(s)) {
                Long count = metric != null && metric.getTotalRows() != null ? metric.getTotalRows().count() : -1L;
                statement.setLong(i, count);
            } else if ("$metrics.totalbytes".equals(s)) {
                Long count = metric != null && metric.getTotalSizeInBytes() != null ? metric.getTotalSizeInBytes().count() : -1L;
                statement.setLong(i, count);
            } else if ("$metrics.failed".equals(s)) {
                Long count = metric != null && metric.getFailed() != null ? metric.getFailed().count() : -1L;
                statement.setLong(i, count);
            } else if ("$metrics.succeeded".equals(s)) {
                Long count = metric != null && metric.getSucceeded() != null ? metric.getSucceeded().count() : -1L;
                statement.setLong(i, count);
            } else if (shouldPrepareDatabaseMetadata()) {
                for (String k : getLastDatabaseMetadata().keySet()) {
>>>>>>> 384d79aa54dc8b08b79075868391fd0f5e6136d9:src/main/java/org/xbib/elasticsearch/jdbc/strategy/standard/StandardSource.java
                    if (k.equals(s)) {
                        statement.setObject(i, getLastDatabaseMetadata().get(k));
Solution content
            if ("$now".equals(s)) {
                Timestamp t = new Timestamp(new DateTime().getMillis());
                statement.setTimestamp(i, t, calendar);
            } else if ("$state".equals(s)) {
                String state = context.getState().name();
                statement.setString(i, state);
            } else if ("$metrics.counter".equals(s) || "$job".equals(s)) { // $job for legacy support
                Long counter = metric != null ? metric.getCounter() : -0L;
                statement.setLong(i, counter);
            } else if ("$lastrowcount".equals(s)) {
                statement.setLong(i, getLastRowCount());
            } else if ("$lastexceptiondate".equals(s)) {
                DateTime dateTime = context.getDateOfThrowable();
                statement.setTimestamp(i, dateTime != null ? new Timestamp(dateTime.getMillis()) : null);
            } else if ("$lastexception".equals(s)) {
                statement.setString(i, ExceptionFormatter.format(context.getThrowable()));
            } else if ("$metrics.lastexecutionstart".equals(s)) {
                DateTime dateTime = metric != null ? metric.getLastExecutionStart() : null;
                statement.setTimestamp(i, dateTime != null ? new Timestamp(dateTime.getMillis()) : null);
            } else if ("$metrics.lastexecutionend".equals(s)) {
                DateTime dateTime = metric != null ? metric.getLastExecutionEnd() : null;
                statement.setTimestamp(i, dateTime != null ? new Timestamp(dateTime.getMillis()) : null);
            } else if ("$metrics.totalrows".equals(s)) {
                Long count = metric != null && metric.getTotalRows() != null ? metric.getTotalRows().count() : -1L;
                statement.setLong(i, count);
            } else if ("$metrics.totalbytes".equals(s)) {
                Long count = metric != null && metric.getTotalSizeInBytes() != null ? metric.getTotalSizeInBytes().count() : -1L;
                statement.setLong(i, count);
            } else if ("$metrics.failed".equals(s)) {
                Long count = metric != null && metric.getFailed() != null ? metric.getFailed().count() : -1L;
                statement.setLong(i, count);
            } else if ("$metrics.succeeded".equals(s)) {
                Long count = metric != null && metric.getSucceeded() != null ? metric.getSucceeded().count() : -1L;
                statement.setLong(i, count);
            } else if (shouldPrepareDatabaseMetadata()) {
                for (String k : getLastDatabaseMetadata().keySet()) {
                    if (k.equals(s)) {
                        statement.setObject(i, getLastDatabaseMetadata().get(k));
                    }
File
StandardSource.java
Developer's decision
Version 2
Kind of conflict
Attribute
Comment
For statement
If statement
Method invocation
Variable
Chunk
Conflicting content
    }

    @Override
<<<<<<< HEAD:src/test/java/org/xbib/elasticsearch/river/jdbc/strategy/mock/MockRiverSource.java
    public void release() throws IOException {
    }

    @Override
    public void shutdown() throws IOException {
=======
    public SourceMetric getMetric() {
        return null;
>>>>>>> 384d79aa54dc8b08b79075868391fd0f5e6136d9:src/test/java/org/xbib/elasticsearch/jdbc/strategy/mock/MockJDBCSource.java
    }

}
Solution content
    }

    @Override
    public SourceMetric getMetric() {
        return null;
    }

}
File
MockJDBCSource.java
Developer's decision
Version 2
Kind of conflict
Annotation
Method declaration
Method signature
Return statement