@Test (dependsOnMethods = "testUpdateSpec") public void testDeleteSpec() throws URISyntaxException, ExecutionException, InterruptedException { Properties headers = new Properties(); headers.put("headerProp1", "headerValue1"); this._fsSpecProducer.deleteSpec(new URI("testDeleteJob"), headers); List<Pair<SpecExecutor.Verb, Spec>> jobSpecs = this._fsSpecConsumer.changedSpecs().get(); Assert.assertEquals(jobSpecs.size(), 1); Assert.assertEquals(jobSpecs.get(0).getLeft(), SpecExecutor.Verb.DELETE); Assert.assertEquals(jobSpecs.get(0).getRight().getUri().toString(), "testDeleteJob"); }
@Override public Future<?> deleteSpec(URI deletedSpecURI, Properties headers) { AvroJobSpec avroJobSpec = AvroJobSpec.newBuilder().setUri(deletedSpecURI.toString()) .setMetadata(ImmutableMap.of(VERB_KEY, SpecExecutor.Verb.DELETE.name())) .setProperties(Maps.fromProperties(headers)).build(); try { writeAvroJobSpec(avroJobSpec); return new CompletedFuture<>(Boolean.TRUE, null); } catch (IOException e) { log.error("Exception encountered when writing DELETE spec"); return new CompletedFuture<>(Boolean.TRUE, e); } }
FsSpecProducer implements SpecProducer<Spec> { @Override public Future<?> deleteSpec(URI deletedSpecURI, Properties headers) { AvroJobSpec avroJobSpec = AvroJobSpec.newBuilder().setUri(deletedSpecURI.toString()) .setMetadata(ImmutableMap.of(VERB_KEY, SpecExecutor.Verb.DELETE.name())) .setProperties(Maps.fromProperties(headers)).build(); try { writeAvroJobSpec(avroJobSpec); return new CompletedFuture<>(Boolean.TRUE, null); } catch (IOException e) { log.error("Exception encountered when writing DELETE spec"); return new CompletedFuture<>(Boolean.TRUE, e); } } }
FsSpecProducer implements SpecProducer<Spec> { @Override public Future<?> deleteSpec(URI deletedSpecURI, Properties headers) { AvroJobSpec avroJobSpec = AvroJobSpec.newBuilder().setUri(deletedSpecURI.toString()) .setMetadata(ImmutableMap.of(VERB_KEY, SpecExecutor.Verb.DELETE.name())) .setProperties(Maps.fromProperties(headers)).build(); try { writeAvroJobSpec(avroJobSpec); return new CompletedFuture<>(Boolean.TRUE, null); } catch (IOException e) { log.error("Exception encountered when writing DELETE spec"); return new CompletedFuture<>(Boolean.TRUE, e); } } FsSpecProducer(Config config);  FsSpecProducer(@Nullable FileSystem fs, Config config); }
FsSpecProducer implements SpecProducer<Spec> { @Override public Future<?> deleteSpec(URI deletedSpecURI, Properties headers) { AvroJobSpec avroJobSpec = AvroJobSpec.newBuilder().setUri(deletedSpecURI.toString()) .setMetadata(ImmutableMap.of(VERB_KEY, SpecExecutor.Verb.DELETE.name())) .setProperties(Maps.fromProperties(headers)).build(); try { writeAvroJobSpec(avroJobSpec); return new CompletedFuture<>(Boolean.TRUE, null); } catch (IOException e) { log.error("Exception encountered when writing DELETE spec"); return new CompletedFuture<>(Boolean.TRUE, e); } } FsSpecProducer(Config config);  FsSpecProducer(@Nullable FileSystem fs, Config config); @Override Future<?> addSpec(Spec addedSpec); @Override Future<?> updateSpec(Spec updatedSpec); @Override Future<?> deleteSpec(URI deletedSpecURI, Properties headers); @Override Future<? extends List<Spec>> listSpecs(); }
FsSpecProducer implements SpecProducer<Spec> { @Override public Future<?> deleteSpec(URI deletedSpecURI, Properties headers) { AvroJobSpec avroJobSpec = AvroJobSpec.newBuilder().setUri(deletedSpecURI.toString()) .setMetadata(ImmutableMap.of(VERB_KEY, SpecExecutor.Verb.DELETE.name())) .setProperties(Maps.fromProperties(headers)).build(); try { writeAvroJobSpec(avroJobSpec); return new CompletedFuture<>(Boolean.TRUE, null); } catch (IOException e) { log.error("Exception encountered when writing DELETE spec"); return new CompletedFuture<>(Boolean.TRUE, e); } } FsSpecProducer(Config config);  FsSpecProducer(@Nullable FileSystem fs, Config config); @Override Future<?> addSpec(Spec addedSpec); @Override Future<?> updateSpec(Spec updatedSpec); @Override Future<?> deleteSpec(URI deletedSpecURI, Properties headers); @Override Future<? extends List<Spec>> listSpecs();  }