Tabnine Logo
RemoteReadWriteTable.executeRecords
Code IndexAdd Tabnine to your IDE (free)

How to use
executeRecords
method
in
org.apache.samza.table.remote.RemoteReadWriteTable

Best Java code snippets using org.apache.samza.table.remote.RemoteReadWriteTable.executeRecords (Showing top 4 results out of 315)

origin: org.apache.samza/samza-core_2.11

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<Void> putAllAsync(List<Entry<K, V>> records) {
 Preconditions.checkNotNull(records);
 if (records.isEmpty()) {
  return CompletableFuture.completedFuture(null);
 }
 writeMetrics.numPutAlls.inc();
 List<K> deleteKeys = records.stream()
   .filter(e -> e.getValue() == null).map(Entry::getKey).collect(Collectors.toList());
 CompletableFuture<Void> deleteFuture = deleteKeys.isEmpty()
   ? CompletableFuture.completedFuture(null) : deleteAllAsync(deleteKeys);
 List<Entry<K, V>> putRecords = records.stream()
   .filter(e -> e.getValue() != null).collect(Collectors.toList());
 // Return the combined future
 return CompletableFuture.allOf(
   deleteFuture,
   executeRecords(writeRateLimiter, putRecords, writeFn::putAllAsync, writeMetrics.putAllNs))
   .exceptionally(e -> {
     String strKeys = records.stream().map(r -> r.getKey().toString()).collect(Collectors.joining(","));
     throw new SamzaException(String.format("Failed to put records with keys=" + strKeys), e);
    });
}
origin: org.apache.samza/samza-core_2.10

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<Void> putAllAsync(List<Entry<K, V>> records) {
 Preconditions.checkNotNull(records);
 if (records.isEmpty()) {
  return CompletableFuture.completedFuture(null);
 }
 writeMetrics.numPutAlls.inc();
 List<K> deleteKeys = records.stream()
   .filter(e -> e.getValue() == null).map(Entry::getKey).collect(Collectors.toList());
 CompletableFuture<Void> deleteFuture = deleteKeys.isEmpty()
   ? CompletableFuture.completedFuture(null) : deleteAllAsync(deleteKeys);
 List<Entry<K, V>> putRecords = records.stream()
   .filter(e -> e.getValue() != null).collect(Collectors.toList());
 // Return the combined future
 return CompletableFuture.allOf(
   deleteFuture,
   executeRecords(writeRateLimiter, putRecords, writeFn::putAllAsync, writeMetrics.putAllNs))
   .exceptionally(e -> {
     String strKeys = records.stream().map(r -> r.getKey().toString()).collect(Collectors.joining(","));
     throw new SamzaException(String.format("Failed to put records with keys=" + strKeys), e);
    });
}
origin: org.apache.samza/samza-core

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<Void> putAllAsync(List<Entry<K, V>> records) {
 Preconditions.checkNotNull(records);
 if (records.isEmpty()) {
  return CompletableFuture.completedFuture(null);
 }
 writeMetrics.numPutAlls.inc();
 List<K> deleteKeys = records.stream()
   .filter(e -> e.getValue() == null).map(Entry::getKey).collect(Collectors.toList());
 CompletableFuture<Void> deleteFuture = deleteKeys.isEmpty()
   ? CompletableFuture.completedFuture(null) : deleteAllAsync(deleteKeys);
 List<Entry<K, V>> putRecords = records.stream()
   .filter(e -> e.getValue() != null).collect(Collectors.toList());
 // Return the combined future
 return CompletableFuture.allOf(
   deleteFuture,
   executeRecords(writeRateLimiter, putRecords, writeFn::putAllAsync, writeMetrics.putAllNs))
   .exceptionally(e -> {
     String strKeys = records.stream().map(r -> r.getKey().toString()).collect(Collectors.joining(","));
     throw new SamzaException(String.format("Failed to put records with keys=" + strKeys), e);
    });
}
origin: org.apache.samza/samza-core_2.12

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<Void> putAllAsync(List<Entry<K, V>> records) {
 Preconditions.checkNotNull(records);
 if (records.isEmpty()) {
  return CompletableFuture.completedFuture(null);
 }
 writeMetrics.numPutAlls.inc();
 List<K> deleteKeys = records.stream()
   .filter(e -> e.getValue() == null).map(Entry::getKey).collect(Collectors.toList());
 CompletableFuture<Void> deleteFuture = deleteKeys.isEmpty()
   ? CompletableFuture.completedFuture(null) : deleteAllAsync(deleteKeys);
 List<Entry<K, V>> putRecords = records.stream()
   .filter(e -> e.getValue() != null).collect(Collectors.toList());
 // Return the combined future
 return CompletableFuture.allOf(
   deleteFuture,
   executeRecords(writeRateLimiter, putRecords, writeFn::putAllAsync, writeMetrics.putAllNs))
   .exceptionally(e -> {
     String strKeys = records.stream().map(r -> r.getKey().toString()).collect(Collectors.joining(","));
     throw new SamzaException(String.format("Failed to put records with keys=" + strKeys), e);
    });
}
org.apache.samza.table.remoteRemoteReadWriteTableexecuteRecords

Popular methods of RemoteReadWriteTable

  • <init>
  • deleteAllAsync
  • deleteAsync
  • execute
  • putAllAsync
  • putAsync

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • getApplicationContext (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Best plugins for Eclipse
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