Tabnine Logo
RocksDbKeyValueReader.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.samza.storage.kv.RocksDbKeyValueReader
constructor

Best Java code snippets using org.apache.samza.storage.kv.RocksDbKeyValueReader.<init> (Showing top 4 results out of 315)

origin: apache/samza

@Test
public void testReadCorrectDbValue() throws RocksDBException {
 HashMap<String, String> map = new HashMap<String, String>();
 map.put("stores." + DB_NAME + ".factory", "mockFactory");
 map.put("stores." + DB_NAME + ".key.serde", "string");
 map.put("stores." + DB_NAME + ".msg.serde", "string");
 Config config = new MapConfig(map);
 RocksDbKeyValueReader reader = new RocksDbKeyValueReader(DB_NAME, dirPath.toString(), config);
 assertEquals("this is string", reader.get("testString"));
 // should throw exception if the input is in other type
 boolean throwClassCastException = false;
 try {
  reader.get(123);
 } catch (Exception e) {
  if (e instanceof ClassCastException) {
   throwClassCastException = true;
  }
 }
 assertTrue(throwClassCastException);
 reader.stop();
 // test with customized serde
 map.put("serializers.registry.mock.class", IntegerSerdeFactory.class.getCanonicalName());
 map.put("stores." + DB_NAME + ".key.serde", "mock");
 map.put("stores." + DB_NAME + ".msg.serde", "mock");
 config = new MapConfig(map);
 reader = new RocksDbKeyValueReader(DB_NAME, dirPath.toString(), config);
 assertEquals(456, reader.get(123));
 assertNull(reader.get(789));
 reader.stop();
}
origin: org.apache.samza/samza-kv-rocksdb_2.11

 public static void main(String[] args) throws RocksDBException {
  RocksDbReadingTool tool = new RocksDbReadingTool();
  OptionSet options = tool.parser().parse(args);
  MapConfig config = tool.loadConfig(options);
  String path = tool.getDbPath();
  String dbName = tool.getDbName();
  RocksDbKeyValueReader kvReader = new RocksDbKeyValueReader(dbName, path, config);

  for (Object obj : tool.getKeys()) {
   Object result = kvReader.get(obj);
   tool.outputResult(obj, result);
  }

  kvReader.stop();
 }
}
origin: apache/samza

 public static void main(String[] args) throws RocksDBException {
  RocksDbReadingTool tool = new RocksDbReadingTool();
  OptionSet options = tool.parser().parse(args);
  MapConfig config = tool.loadConfig(options);
  String path = tool.getDbPath();
  String dbName = tool.getDbName();
  RocksDbKeyValueReader kvReader = new RocksDbKeyValueReader(dbName, path, config);

  for (Object obj : tool.getKeys()) {
   Object result = kvReader.get(obj);
   tool.outputResult(obj, result);
  }

  kvReader.stop();
 }
}
origin: org.apache.samza/samza-kv-rocksdb

 public static void main(String[] args) throws RocksDBException {
  RocksDbReadingTool tool = new RocksDbReadingTool();
  OptionSet options = tool.parser().parse(args);
  MapConfig config = tool.loadConfig(options);
  String path = tool.getDbPath();
  String dbName = tool.getDbName();
  RocksDbKeyValueReader kvReader = new RocksDbKeyValueReader(dbName, path, config);

  for (Object obj : tool.getKeys()) {
   Object result = kvReader.get(obj);
   tool.outputResult(obj, result);
  }

  kvReader.stop();
 }
}
org.apache.samza.storage.kvRocksDbKeyValueReader<init>

Javadoc

Construct the RocksDbKeyValueReader with store's name, database's path and Samza's config

Popular methods of RocksDbKeyValueReader

  • get
    get the value from the key. This key will be serialized to bytes using the serde defined in systems.
  • stop
  • getSerdeFromName
    A helper method to get the Serde from the serdeName

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Path (java.nio.file)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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