test_class.declarator: writer
test_class.original_string: AsyncDataWriter<String> writer;
test_class.type: AsyncDataWriter<String>
test_class.var_name: writer
test_class.declarator: ex = Executors.newFixedThreadPool(5)
test_class.original_string: Executor ex = Executors.newFixedThreadPool(5);
test_class.type: Executor
test_class.var_name: ex
test_class.declarator: bus
test_class.original_string: EventBus bus;
test_class.type: EventBus
test_class.var_name: bus
test_class.declarator: dummyMc
test_class.modifier: private
test_class.original_string: private DummyManifestComparator<String> dummyMc;
test_class.type: DummyManifestComparator<String>
test_class.var_name: dummyMc
test_class.declarator: eventRecieved
test_class.original_string: AtomicInteger eventRecieved;
test_class.type: AtomicInteger
test_class.var_name: eventRecieved
test_class.file: micro-async-data-writer/src/test/java/com/oath/micro/server/async/data/writer/AsyncDataWriterTest.java
test_class.identifier: AsyncDataWriterTest
test_case.body: @Test
      public void testSaveAndIncrement() {
          assertThat(eventRecieved.get(), equalTo(0));
          writer.saveAndIncrement("boo!");
          Future<String> res = writer.loadAndGet();
          assertThat(res.get(), equalTo(Try.success("boo!")));
          assertThat(eventRecieved.get(), equalTo(2));
      }
test_case.class_method_signature: AsyncDataWriterTest.testSaveAndIncrement()
test_case.full_signature: @Test public void testSaveAndIncrement()
test_case.identifier: testSaveAndIncrement
test_case.invocations: assertThat get equalTo saveAndIncrement loadAndGet assertThat get equalTo success assertThat get equalTo
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSaveAndIncrement()
focal_class.declarator: MANIFEST_COMPARATOR_DATA_LOADER_KEY = "Manifest Comparator AsyncDataWriter Load Operation"
focal_class.modifier: public static final
focal_class.original_string: public static final String MANIFEST_COMPARATOR_DATA_LOADER_KEY = "Manifest Comparator AsyncDataWriter Load Operation";
focal_class.type: String
focal_class.var_name: MANIFEST_COMPARATOR_DATA_LOADER_KEY
focal_class.declarator: MANIFEST_COMPARATOR_DATA_WRITER_KEY = "Manifest Comparator AsyncDataWriter Save and increment Operation"
focal_class.modifier: public static final
focal_class.original_string: public static final String MANIFEST_COMPARATOR_DATA_WRITER_KEY = "Manifest Comparator AsyncDataWriter Save and increment Operation";
focal_class.type: String
focal_class.var_name: MANIFEST_COMPARATOR_DATA_WRITER_KEY
focal_class.declarator: executorService
focal_class.modifier: private final
focal_class.original_string: private final Executor executorService;
focal_class.type: Executor
focal_class.var_name: executorService
focal_class.declarator: comparator
focal_class.modifier: private final
focal_class.original_string: private final ManifestComparator<T> comparator;
focal_class.type: ManifestComparator<T>
focal_class.var_name: comparator
focal_class.declarator: r = new Random()
focal_class.modifier: private final
focal_class.original_string: private final Random r = new Random();
focal_class.type: Random
focal_class.var_name: r
focal_class.declarator: bus
focal_class.modifier: private final
focal_class.original_string: private final EventBus bus;
focal_class.type: EventBus
focal_class.var_name: bus
focal_class.file: micro-async-data-writer/src/main/java/com/oath/micro/server/async/data/writer/AsyncDataWriter.java
focal_class.identifier: AsyncDataWriter
focal_class.interfaces: implements DataWriter<T>
focal_class.class_method_signature: AsyncDataWriter.asyncDataWriter(Executor executorService, ManifestComparator<T> comparator)
focal_class.full_signature: public static AsyncDataWriter<T> asyncDataWriter(Executor executorService, ManifestComparator<T> comparator)
focal_class.identifier: asyncDataWriter
focal_class.modifiers: public static
focal_class.parameters: (Executor executorService, ManifestComparator<T> comparator)
focal_class.return: AsyncDataWriter<T>
focal_class.signature: AsyncDataWriter<T> asyncDataWriter(Executor executorService, ManifestComparator<T> comparator)
focal_class.class_method_signature: AsyncDataWriter.asyncDataWriter(Executor executorService, ManifestComparator<T> comparator,
              EventBus bus)
focal_class.full_signature: public static AsyncDataWriter<T> asyncDataWriter(Executor executorService, ManifestComparator<T> comparator,
              EventBus bus)
focal_class.identifier: asyncDataWriter
focal_class.modifiers: public static
focal_class.parameters: (Executor executorService, ManifestComparator<T> comparator,
              EventBus bus)
focal_class.return: AsyncDataWriter<T>
focal_class.signature: AsyncDataWriter<T> asyncDataWriter(Executor executorService, ManifestComparator<T> comparator,
              EventBus bus)
focal_class.class_method_signature: AsyncDataWriter.loadAndGet()
focal_class.full_signature: @Override public Future<T> loadAndGet()
focal_class.identifier: loadAndGet
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Future<T>
focal_class.signature: Future<T> loadAndGet()
focal_class.class_method_signature: AsyncDataWriter.saveAndIncrement(T data)
focal_class.full_signature: @Override public Future<Void> saveAndIncrement(T data)
focal_class.identifier: saveAndIncrement
focal_class.modifiers: @Override public
focal_class.parameters: (T data)
focal_class.return: Future<Void>
focal_class.signature: Future<Void> saveAndIncrement(T data)
focal_class.class_method_signature: AsyncDataWriter.isOutOfDate()
focal_class.full_signature: @Override public Future<Boolean> isOutOfDate()
focal_class.identifier: isOutOfDate
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Future<Boolean>
focal_class.signature: Future<Boolean> isOutOfDate()
focal_method.body: @Override
      public Future<Void> saveAndIncrement(T data) {
          String correlationId = "" + System.currentTimeMillis() + ":" + r.nextLong();
          Supplier<MapX<String, String>> dataMap = () -> MapX.fromMap(HashMapBuilder.map(MANIFEST_COMPARATOR_DATA_WRITER_KEY,
                                                                                         comparator.toString())
                                                                                    .build());
          return Future.<Void> of(() -> {
              comparator.saveAndIncrement(data);
              return null;
          } , executorService)
                        .peek(t -> bus.post(SystemData.<String, String> builder()
                                                      .correlationId(correlationId)
                                                      .dataMap(dataMap.get())
                                                      .errors(0)
                                                      .processed(1)
                                                      .build())); // add
                                                                  // recover
                                                                  // option
                                                                  // here
                                                                  // also
                                                                  // with
                                                                  // cyclops-react
                                                                  // 1.0.0-final
  
      }
focal_method.class_method_signature: AsyncDataWriter.saveAndIncrement(T data)
focal_method.full_signature: @Override public Future<Void> saveAndIncrement(T data)
focal_method.identifier: saveAndIncrement
focal_method.invocations: currentTimeMillis nextLong fromMap build map toString peek of saveAndIncrement post build processed errors dataMap correlationId builder get
focal_method.modifiers: @Override public
focal_method.parameters: (T data)
focal_method.return: Future<Void>
focal_method.signature: Future<Void> saveAndIncrement(T data)