@Test @Ignore public void updateOrInsert() throws Exception { EsDailySnapshotStoreFactory factory = new EsDailySnapshotStoreFactory(); EsDailySnapshotStore store = (EsDailySnapshotStore) factory.getDailyStore(DateTime.parse("2016-07-14")); EsDailySnapshotInstance inst = new EsDailySnapshotInstance(); inst.setId("i-123456789"); inst.setName("test123"); inst.setLaunchTime(DateTime.now().toDate()); inst.setServiceMappings(new String[]{"mapping"}); store.updateOrInsert(inst); }
@Override public long updateOrInsert(EsDailySnapshotInstance instance) throws Exception { byte[] doc = essnapshotinstanceMapper.writeValueAsBytes(instance); UpdateResponse response = this.updateOrInsert(instance.getId(), doc, doc); return response.getVersion(); }
EsDailySnapshotStore extends EsStore implements DailySnapshotStore { @Override public long updateOrInsert(EsDailySnapshotInstance instance) throws Exception { byte[] doc = essnapshotinstanceMapper.writeValueAsBytes(instance); UpdateResponse response = this.updateOrInsert(instance.getId(), doc, doc); return response.getVersion(); } }
EsDailySnapshotStore extends EsStore implements DailySnapshotStore { @Override public long updateOrInsert(EsDailySnapshotInstance instance) throws Exception { byte[] doc = essnapshotinstanceMapper.writeValueAsBytes(instance); UpdateResponse response = this.updateOrInsert(instance.getId(), doc, doc); return response.getVersion(); } EsDailySnapshotStore(DateTime day); }
EsDailySnapshotStore extends EsStore implements DailySnapshotStore { @Override public long updateOrInsert(EsDailySnapshotInstance instance) throws Exception { byte[] doc = essnapshotinstanceMapper.writeValueAsBytes(instance); UpdateResponse response = this.updateOrInsert(instance.getId(), doc, doc); return response.getVersion(); } EsDailySnapshotStore(DateTime day); @Override String getIndexName(); @Override String getDocTypeName(); @Override EsDailySnapshotInstance getInstanceById(String instanceId); @Override long updateOrInsert(EsDailySnapshotInstance instance); @Override long update(EsDailySnapshotInstance instance); @Override Iterator<EsDailySnapshotInstance> getSnapshotInstances(); @Override void bulkInsert(List<EsDailySnapshotInstance> instances); @Override void bulkUpdate(List<EsDailySnapshotInstance> instances); }
EsDailySnapshotStore extends EsStore implements DailySnapshotStore { @Override public long updateOrInsert(EsDailySnapshotInstance instance) throws Exception { byte[] doc = essnapshotinstanceMapper.writeValueAsBytes(instance); UpdateResponse response = this.updateOrInsert(instance.getId(), doc, doc); return response.getVersion(); } EsDailySnapshotStore(DateTime day); @Override String getIndexName(); @Override String getDocTypeName(); @Override EsDailySnapshotInstance getInstanceById(String instanceId); @Override long updateOrInsert(EsDailySnapshotInstance instance); @Override long update(EsDailySnapshotInstance instance); @Override Iterator<EsDailySnapshotInstance> getSnapshotInstances(); @Override void bulkInsert(List<EsDailySnapshotInstance> instances); @Override void bulkUpdate(List<EsDailySnapshotInstance> instances);  }