Tabnine Logo
TableWriteFunction.flush
Code IndexAdd Tabnine to your IDE (free)

How to use
flush
method
in
org.apache.samza.table.remote.TableWriteFunction

Best Java code snippets using org.apache.samza.table.remote.TableWriteFunction.flush (Showing top 9 results out of 315)

origin: apache/samza

@Override
public void flush() {
 if (writeFn != null) {
  writeFn.flush();
 }
}
origin: org.apache.samza/samza-core

/**
 * {@inheritDoc}
 */
@Override
public void flush() {
 try {
  writeMetrics.numFlushes.inc();
  long startNs = System.nanoTime();
  writeFn.flush();
  writeMetrics.flushNs.update(System.nanoTime() - startNs);
 } catch (Exception e) {
  String errMsg = "Failed to flush remote store";
  logger.error(errMsg, e);
  throw new SamzaException(errMsg, e);
 }
}
origin: org.apache.samza/samza-core_2.10

/**
 * {@inheritDoc}
 */
@Override
public void flush() {
 try {
  writeMetrics.numFlushes.inc();
  long startNs = System.nanoTime();
  writeFn.flush();
  writeMetrics.flushNs.update(System.nanoTime() - startNs);
 } catch (Exception e) {
  String errMsg = "Failed to flush remote store";
  logger.error(errMsg, e);
  throw new SamzaException(errMsg, e);
 }
}
origin: org.apache.samza/samza-core_2.11

/**
 * {@inheritDoc}
 */
@Override
public void flush() {
 try {
  writeMetrics.numFlushes.inc();
  long startNs = System.nanoTime();
  writeFn.flush();
  writeMetrics.flushNs.update(System.nanoTime() - startNs);
 } catch (Exception e) {
  String errMsg = "Failed to flush remote store";
  logger.error(errMsg, e);
  throw new SamzaException(errMsg, e);
 }
}
origin: org.apache.samza/samza-core_2.12

/**
 * {@inheritDoc}
 */
@Override
public void flush() {
 try {
  writeMetrics.numFlushes.inc();
  long startNs = System.nanoTime();
  writeFn.flush();
  writeMetrics.flushNs.update(System.nanoTime() - startNs);
 } catch (Exception e) {
  String errMsg = "Failed to flush remote store";
  logger.error(errMsg, e);
  throw new SamzaException(errMsg, e);
 }
}
origin: apache/samza

@Test
public void testFlush() {
 roTable.flush();
 verify(writeFn, times(0)).flush();
 rwTable.flush();
 verify(writeFn, times(1)).flush();
}
origin: apache/samza

@Test
public void testFlush() {
 TableWriteFunction<String, String> writeFn = mock(TableWriteFunction.class);
 RemoteTable<String, String> table = getTable("testFlush", mock(TableReadFunction.class), writeFn, false);
 table.flush();
 verify(writeFn, times(1)).flush();
}
origin: apache/samza

 @Test
 public void testFlushAndClose() {
  TableRetryPolicy policy = new TableRetryPolicy();
  policy.withFixedBackoff(Duration.ofMillis(100));
  TableReadFunction readFn = mock(TableReadFunction.class);
  TableWriteFunction writeFn = mock(TableWriteFunction.class);
  AsyncReadWriteTable delegate = new AsyncRemoteTable(readFn, writeFn);
  AsyncRetriableTable table = new AsyncRetriableTable("t1", delegate, null, policy, schedExec, readFn, writeFn);

  table.flush();
  verify(writeFn, times(1)).flush();

  table.close();
  verify(readFn, times(1)).close();
  verify(writeFn, times(1)).close();
 }
}
origin: apache/samza

@Test
public void testFlushAndClose() {
 TableRateLimiter readRateLimiter = mock(TableRateLimiter.class);
 TableRateLimiter writeRateLimiter = mock(TableRateLimiter.class);
 TableReadFunction<String, String> readFn = mock(TableReadFunction.class);
 TableWriteFunction<String, String> writeFn = mock(TableWriteFunction.class);
 AsyncReadWriteTable delegate = new AsyncRemoteTable(readFn, writeFn);
 AsyncRateLimitedTable table = new AsyncRateLimitedTable("t1", delegate,
   readRateLimiter, writeRateLimiter, schedExec);
 table.init(TestRemoteTable.getMockContext());
 table.flush();
 verify(writeFn, times(1)).flush();
 table.close();
 verify(readFn, times(1)).close();
 verify(writeFn, times(1)).close();
}
org.apache.samza.table.remoteTableWriteFunctionflush

Javadoc

Flush the remote store (optional)

Popular methods of TableWriteFunction

  • deleteAllAsync
    Asynchronously delete all records with the specified keys from the remote store. The default impleme
  • deleteAsync
    Asynchronously delete the record with specified key from the remote store
  • putAllAsync
    Asynchronously store the table records with specified keys. This method must be thread-safe. The def
  • putAsync
    Asynchronously store single table record with specified key. This method must be thread-safe.
  • close
  • init
  • isRetriable
    Determine whether the current operation can be retried with the last thrown exception.

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now