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

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

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

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

/**
 * {@inheritDoc}
 */
@Override
public void deleteAll(List<K> keys) {
 try {
  deleteAllAsync(keys).get();
 } catch (Exception e) {
  throw new SamzaException(e);
 }
}
origin: org.apache.samza/samza-core_2.11

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<Void> putAsync(K key, V value) {
 Preconditions.checkNotNull(key);
 if (value == null) {
  return deleteAsync(key);
 }
 writeMetrics.numPuts.inc();
 return execute(writeRateLimiter, key, value, writeFn::putAsync, writeMetrics.putNs)
   .exceptionally(e -> {
     throw new SamzaException("Failed to put a record with key=" + key, (Throwable) e);
    });
}
origin: org.apache.samza/samza-core

/**
 * {@inheritDoc}
 */
@Override
public void putAll(List<Entry<K, V>> entries) {
 try {
  putAllAsync(entries).get();
 } catch (Exception e) {
  throw new SamzaException(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_2.10

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<Void> deleteAsync(K key) {
 Preconditions.checkNotNull(key);
 writeMetrics.numDeletes.inc();
 return execute(writeRateLimiter, key, writeFn::deleteAsync, writeMetrics.deleteNs)
   .exceptionally(e -> {
     throw new SamzaException(String.format("Failed to delete the record for " + key), (Throwable) e);
    });
}
origin: org.apache.samza/samza-core_2.11

/**
 * {@inheritDoc}
 */
@Override
public void put(K key, V value) {
 try {
  putAsync(key, value).get();
 } catch (Exception e) {
  throw new SamzaException(e);
 }
}
origin: org.apache.samza/samza-core_2.10

/**
 * {@inheritDoc}
 */
@Override
public void delete(K key) {
 try {
  deleteAsync(key).get();
 } catch (Exception e) {
  throw new SamzaException(e);
 }
}
origin: org.apache.samza/samza-core_2.10

   tableExecutors.get(tableId), callbackExecutors.get(tableId));
} else {
 table = new RemoteReadWriteTable(tableSpec.getId(), readFn, writeFn, readRateLimiter,
   writeRateLimiter, tableExecutors.get(tableId), callbackExecutors.get(tableId));
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);
    });
}
origin: org.apache.samza/samza-core_2.11

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<Void> deleteAsync(K key) {
 Preconditions.checkNotNull(key);
 writeMetrics.numDeletes.inc();
 return execute(writeRateLimiter, key, writeFn::deleteAsync, writeMetrics.deleteNs)
   .exceptionally(e -> {
     throw new SamzaException(String.format("Failed to delete the record for " + key), (Throwable) e);
    });
}
origin: org.apache.samza/samza-core_2.10

/**
 * {@inheritDoc}
 */
@Override
public void put(K key, V value) {
 try {
  putAsync(key, value).get();
 } catch (Exception e) {
  throw new SamzaException(e);
 }
}
origin: org.apache.samza/samza-core_2.12

/**
 * {@inheritDoc}
 */
@Override
public void delete(K key) {
 try {
  deleteAsync(key).get();
 } catch (Exception e) {
  throw new SamzaException(e);
 }
}
origin: org.apache.samza/samza-core

   tableExecutors.get(tableId), callbackExecutors.get(tableId));
} else {
 table = new RemoteReadWriteTable(tableSpec.getId(), readFn, writeFn, readRateLimiter,
   writeRateLimiter, tableExecutors.get(tableId), callbackExecutors.get(tableId));
origin: org.apache.samza/samza-core

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<Void> putAsync(K key, V value) {
 Preconditions.checkNotNull(key);
 if (value == null) {
  return deleteAsync(key);
 }
 writeMetrics.numPuts.inc();
 return execute(writeRateLimiter, key, value, writeFn::putAsync, writeMetrics.putNs)
   .exceptionally(e -> {
     throw new SamzaException("Failed to put a record with key=" + key, (Throwable) e);
    });
}
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

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<Void> deleteAsync(K key) {
 Preconditions.checkNotNull(key);
 writeMetrics.numDeletes.inc();
 return execute(writeRateLimiter, key, writeFn::deleteAsync, writeMetrics.deleteNs)
   .exceptionally(e -> {
     throw new SamzaException(String.format("Failed to delete the record for " + key), (Throwable) e);
    });
}
origin: org.apache.samza/samza-core

/**
 * {@inheritDoc}
 */
@Override
public void put(K key, V value) {
 try {
  putAsync(key, value).get();
 } catch (Exception e) {
  throw new SamzaException(e);
 }
}
origin: org.apache.samza/samza-core_2.11

/**
 * {@inheritDoc}
 */
@Override
public void deleteAll(List<K> keys) {
 try {
  deleteAllAsync(keys).get();
 } catch (Exception e) {
  throw new SamzaException(e);
 }
}
origin: org.apache.samza/samza-core_2.12

/**
 * {@inheritDoc}
 */
@Override
public void putAll(List<Entry<K, V>> entries) {
 try {
  putAllAsync(entries).get();
 } catch (Exception e) {
  throw new SamzaException(e);
 }
}
origin: org.apache.samza/samza-core

/**
 * {@inheritDoc}
 */
@Override
public void delete(K key) {
 try {
  deleteAsync(key).get();
 } catch (Exception e) {
  throw new SamzaException(e);
 }
}
org.apache.samza.table.remoteRemoteReadWriteTable

Javadoc

Remote store backed read writable table

Most used methods

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

Popular in Java

  • Finding current android device location
  • getExternalFilesDir (Context)
  • getResourceAsStream (ClassLoader)
  • setScale (BigDecimal)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Top Vim plugins
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