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
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • getApplicationContext (Context)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Runner (org.openjdk.jmh.runner)
  • 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