Codota Logo
RemoteReadWriteTable
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
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.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_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.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

/**
 * {@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_2.12

/**
 * {@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.12

/**
 * {@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

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • runOnUiThread (Activity)
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now