public String getSerdeClass(String name) { return get(String.format(SERDE, name), null); }
/** * Useful for getting individual serializers. * @return a list of all serializer names from the config file */ public List<String> getSerdeNames() { List<String> results = new ArrayList<String>(); Config subConfig = subset(String.format(SERIALIZER_PREFIX, ""), true); for (String key : subConfig.keySet()) { if (key.endsWith(".class")) { results.add(key.replace(".class", "")); } } return results; } }
/** * A helper method to get the Serde from the serdeName * * @param name serde name * @param serializerConfig serializer config * @return a Serde of this serde name */ private Serde<Object> getSerdeFromName(String name, JavaSerializerConfig serializerConfig) { String serdeClassName = serializerConfig.getSerdeClass(name); if (serdeClassName == null) { serdeClassName = SerializerConfig$.MODULE$.getSerdeFactoryName(name); } return Util.getObj(serdeClassName, SerdeFactory.class).getSerde(name, serializerConfig); } }
/** * Construct the <code>RocksDbKeyValueReader</code> with store's name, * database's path and Samza's config * * @param storeName name of the RocksDb defined in the config file * @param dbPath path to the db directory * @param config Samza's config */ public RocksDbKeyValueReader(String storeName, String dbPath, Config config) { // get the key serde and value serde from the config JavaStorageConfig storageConfig = new JavaStorageConfig(config); JavaSerializerConfig serializerConfig = new JavaSerializerConfig(config); keySerde = getSerdeFromName(storageConfig.getStorageKeySerde(storeName), serializerConfig); valueSerde = getSerdeFromName(storageConfig.getStorageMsgSerde(storeName), serializerConfig); // get db options Options options = RocksDbOptionsHelper.options(config, 1, new File(dbPath), StorageEngineFactory.StoreMode.ReadWrite); // open the db RocksDB.loadLibrary(); try { db = RocksDB.openReadOnly(options, dbPath); } catch (RocksDBException e) { throw new SamzaException("can not open the rocksDb in " + dbPath, e); } }
/** * A helper method to get the Serde from the serdeName * * @param name serde name * @param serializerConfig serializer config * @return a Serde of this serde name */ private Serde<Object> getSerdeFromName(String name, JavaSerializerConfig serializerConfig) { String serdeClassName = serializerConfig.getSerdeClass(name); if (serdeClassName == null) { serdeClassName = SerializerConfig$.MODULE$.getSerdeFactoryName(name); } return Util.getObj(serdeClassName, SerdeFactory.class).getSerde(name, serializerConfig); } }
/** * Construct the <code>RocksDbKeyValueReader</code> with store's name, * database's path and Samza's config * * @param storeName name of the RocksDb defined in the config file * @param dbPath path to the db directory * @param config Samza's config */ public RocksDbKeyValueReader(String storeName, String dbPath, Config config) { // get the key serde and value serde from the config JavaStorageConfig storageConfig = new JavaStorageConfig(config); JavaSerializerConfig serializerConfig = new JavaSerializerConfig(config); keySerde = getSerdeFromName(storageConfig.getStorageKeySerde(storeName), serializerConfig); valueSerde = getSerdeFromName(storageConfig.getStorageMsgSerde(storeName), serializerConfig); // get db options Options options = RocksDbOptionsHelper.options(config, 1); // open the db RocksDB.loadLibrary(); try { db = RocksDB.openReadOnly(options, dbPath); } catch (RocksDBException e) { throw new SamzaException("can not open the rocksDb in " + dbPath, e); } }
public String getSerdeClass(String name) { return get(String.format(SERDE, name), null); }
/** * Useful for getting individual serializers. * @return a list of all serializer names from the config file */ public List<String> getSerdeNames() { List<String> results = new ArrayList<String>(); Config subConfig = subset(String.format(SERIALIZER_PREFIX, ""), true); for (String key : subConfig.keySet()) { if (key.endsWith(".class")) { results.add(key.replace(".class", "")); } } return results; } }
/** * A helper method to get the Serde from the serdeName * * @param name serde name * @param serializerConfig serializer config * @return a Serde of this serde name */ private Serde<Object> getSerdeFromName(String name, JavaSerializerConfig serializerConfig) { String serdeClassName = serializerConfig.getSerdeClass(name); if (serdeClassName == null) { serdeClassName = SerializerConfig$.MODULE$.getSerdeFactoryName(name); } return Util.getObj(serdeClassName, SerdeFactory.class).getSerde(name, serializerConfig); } }
/** * Construct the <code>RocksDbKeyValueReader</code> with store's name, * database's path and Samza's config * * @param storeName name of the RocksDb defined in the config file * @param dbPath path to the db directory * @param config Samza's config */ public RocksDbKeyValueReader(String storeName, String dbPath, Config config) { // get the key serde and value serde from the config JavaStorageConfig storageConfig = new JavaStorageConfig(config); JavaSerializerConfig serializerConfig = new JavaSerializerConfig(config); keySerde = getSerdeFromName(storageConfig.getStorageKeySerde(storeName), serializerConfig); valueSerde = getSerdeFromName(storageConfig.getStorageMsgSerde(storeName), serializerConfig); // get db options Options options = RocksDbOptionsHelper.options(config, 1); // open the db RocksDB.loadLibrary(); try { db = RocksDB.openReadOnly(options, dbPath); } catch (RocksDBException e) { throw new SamzaException("can not open the rocksDb in " + dbPath, e); } }
public String getSerdeClass(String name) { return get(String.format(SERDE, name), null); }
/** * Useful for getting individual serializers. * @return a list of all serializer names from the config file */ public List<String> getSerdeNames() { List<String> results = new ArrayList<String>(); Config subConfig = subset(String.format(SERIALIZER_PREFIX, ""), true); for (String key : subConfig.keySet()) { if (key.endsWith(".class")) { results.add(key.replace(".class", "")); } } return results; } }
public String getSerdeClass(String name) { return get(String.format(SERDE, name), null); }
/** * Useful for getting individual serializers. * @return a list of all serializer names from the config file */ public List<String> getSerdeNames() { List<String> results = new ArrayList<String>(); Config subConfig = subset(String.format(SERIALIZER_PREFIX, ""), true); for (String key : subConfig.keySet()) { if (key.endsWith(".class")) { results.add(key.replace(".class", "")); } } return results; } }
public String getSerdeClass(String name) { return get(String.format(SERDE, name), null); }
/** * Useful for getting individual serializers. * @return a list of all serializer names from the config file */ public List<String> getSerdeNames() { List<String> results = new ArrayList<String>(); Config subConfig = subset(String.format(SERIALIZER_PREFIX, ""), true); for (String key : subConfig.keySet()) { if (key.endsWith(".class")) { results.add(key.replace(".class", "")); } } return results; } }