Package org.elasticsearch.river.mongodb

Examples of org.elasticsearch.river.mongodb.MongoDBRiverDefinition


        int i = 0;
        for (SearchHit hit : searchResponse.getHits().hits()) {
            Map<String, Object> source = new HashMap<String, Object>();
            String riverName = hit.getType();
            RiverSettings riverSettings = new RiverSettings(null, hit.getSource());
            MongoDBRiverDefinition definition = MongoDBRiverDefinition.parseSettings(riverName, riverIndexName, riverSettings, null);

            Timestamp<?> ts = MongoDBRiver.getLastTimestamp(esClient, definition);
            Long lastTimestamp = null;
            if (ts != null) {
                lastTimestamp = ts.getTime();
View Full Code Here


                    .exists(new IndicesExistsRequest(getIndex()));
            assertThat(response.actionGet().isExists(), equalTo(true));
            assertThat(getNode().client().count(countRequest(getIndex())).actionGet().getCount(), equalTo(1l));
            assertThat(MongoDBRiverHelper.getRiverStatus(getNode().client(), getRiver()), equalTo(Status.RUNNING));

            MongoDBRiverDefinition definition = getMongoDBRiverDefinition(TEST_MONGODB_RIVER_SIMPLE_JSON, getDatabase(), getCollection(),
                    getIndex());
            assertThat(MongoDBRiver.getLastTimestamp(getNode().client(), definition), notNullValue());

            // Check that it syncs the oplog
            DBObject dbObject2 = new BasicDBObject(ImmutableMap.of("name", "Ben"));
View Full Code Here

        logger.debug("Start ImportFailWithExistingDataInSameIndexType");
        try {
            super.deleteIndex();
            Assert.assertTrue(getIndicesAdminClient().prepareCreate(getIndex()).get().isAcknowledged());
            refreshIndex();
            MongoDBRiverDefinition definition = getMongoDBRiverDefinition(TEST_MONGODB_RIVER_SIMPLE_JSON, getDatabase(), getCollection(),
                    getIndex());
            String id = getNode().client().prepareIndex(getIndex(), definition.getTypeName()).setSource("name", "John").get().getId();
            Assert.assertNotNull(id);

            createDatabase();
            DBObject dbObject1 = new BasicDBObject(ImmutableMap.of("name", "Richard"));
            WriteResult result1 = mongoCollection.insert(dbObject1);
View Full Code Here

        logger.debug("Start skipImportFailWithExistingDataInSameIndexType");
        try {
            super.deleteIndex();
            Assert.assertTrue(getIndicesAdminClient().prepareCreate(getIndex()).get().isAcknowledged());
            refreshIndex();
            MongoDBRiverDefinition definition = getMongoDBRiverDefinition(TEST_MONGODB_RIVER_SIMPLE_JSON, getDatabase(), getCollection(),
                    getIndex());
            String id = getNode().client().prepareIndex(getIndex(), definition.getTypeName()).setSource("name", "John").get().getId();
            Assert.assertNotNull(id);

            createDatabase();
            DBObject dbObject1 = new BasicDBObject(ImmutableMap.of("name", "Richard"));
            WriteResult result1 = mongoCollection.insert(dbObject1);
View Full Code Here

TOP

Related Classes of org.elasticsearch.river.mongodb.MongoDBRiverDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.