Tabnine Logo
org.apache.samza.storage
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.samza.storage

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

origin: apache/samza

/**
 * Cleans up and sets up store directories, validates changeLog SSPs for all stores of this task,
 * and registers SSPs with the respective consumers.
 */
public void initialize() {
 cleanBaseDirsAndReadOffsetFiles();
 setupBaseDirs();
 validateChangelogStreams();
 getOldestChangeLogOffsets();
 registerStartingOffsets();
}
origin: apache/samza

 public StoreProperties build() {
  return new StoreProperties(persistedToDisk, loggedStore);
 }
}
origin: apache/samza

 public static void main(String[] args) {
  StateStorageTool tool = new StateStorageTool();
  OptionSet options = tool.parser().parse(args);
  MapConfig config = tool.loadConfig(options);
  String path = tool.getPath();

  StorageRecovery storageRecovery = new StorageRecovery(config, path);
  storageRecovery.run();
 }
}
origin: apache/samza

private boolean isValidSideInputStore(String storeName, File storeLocation) {
 return isPersistedStore(storeName)
   && !StorageManagerUtil.isStaleStore(storeLocation, OFFSET_FILE, STORE_DELETE_RETENTION_MS, clock.currentTimeMillis())
   && StorageManagerUtil.isOffsetFileValid(storeLocation, OFFSET_FILE);
}
origin: apache/samza

/**
 * setup phase which assigns required values to the variables used for all
 * tasks.
 */
private void setup() {
 log.info("setting up the recovery...");
 getContainerModels();
 getChangeLogSystemStreamsAndStorageFactories();
 getChangeLogMaxPartitionNumber();
 getContainerStorageManagers();
}
origin: apache/samza

@Test
public void testWriteOffsetFilesForNonPersistedStore() {
 final String storeName = "test-write-offset-non-persisted-store";
 final String taskName = "test-write-offset-for-non-persisted-task";
 TaskSideInputStorageManager testSideInputStorageManager = new MockTaskSideInputStorageManagerBuilder(taskName, NON_LOGGED_STORE_DIR)
   .addInMemoryStore(storeName, ImmutableSet.of())
   .build();
 initializeSideInputStorageManager(testSideInputStorageManager);
 testSideInputStorageManager.writeOffsetFiles(); // should be no-op
 File storeDir = testSideInputStorageManager.getStoreLocation(storeName);
 assertFalse("Store directory: " + storeDir.getPath() + " should not be created for non-persisted store", storeDir.exists());
}
origin: apache/samza

@Test
public void testStop() {
 final String storeName = "test-stop-store";
 final String taskName = "test-stop-task";
 TaskSideInputStorageManager testSideInputStorageManager = new MockTaskSideInputStorageManagerBuilder(taskName, NON_LOGGED_STORE_DIR)
   .addInMemoryStore(storeName, ImmutableSet.of())
   .build();
 initializeSideInputStorageManager(testSideInputStorageManager);
 testSideInputStorageManager.stop();
 verify(testSideInputStorageManager.getStore(storeName)).stop();
 verify(testSideInputStorageManager).writeOffsetFiles();
}
origin: apache/samza

@Test
public void testInit() {
 final String storeName = "test-init-store";
 final String taskName = "test-init-task";
 TaskSideInputStorageManager testSideInputStorageManager = new MockTaskSideInputStorageManagerBuilder(taskName, LOGGED_STORE_DIR)
   .addLoggedStore(storeName, ImmutableSet.of())
   .build();
 initializeSideInputStorageManager(testSideInputStorageManager);
 File storeDir = testSideInputStorageManager.getStoreLocation(storeName);
 assertTrue("Store directory: " + storeDir.getPath() + " is missing.", storeDir.exists());
}
origin: apache/samza

 @Override
 public StorageEngine getStorageEngine(String storeName,
   File storeDir,
   Serde<Object> keySerde,
   Serde<Object> msgSerde,
   MessageCollector collector,
   MetricsRegistry registry,
   SystemStreamPartition changeLogSystemStreamPartition,
   JobContext jobContext,
   ContainerContext containerContext, StoreMode storeMode) {
  StoreProperties storeProperties = new StoreProperties.StorePropertiesBuilder().setLoggedStore(true).build();
  return new MockStorageEngine(storeName, storeDir, changeLogSystemStreamPartition, storeProperties);
 }
}
origin: apache/samza

@Before
public void setup() throws InterruptedException {
 putConfig();
 putMetadata();
}
origin: apache/samza

 TaskSideInputStorageManager build() {
  return spy(new TaskSideInputStorageManager(taskName, streamMetadataCache, storeBaseDir, stores,
    storeToProcessor, storeToSSps, systemAdmins, mock(Config.class), clock));
 }
}
origin: org.apache.samza/samza-core

 public static void main(String[] args) {
  StateStorageTool tool = new StateStorageTool();
  OptionSet options = tool.parser().parse(args);
  MapConfig config = tool.loadConfig(options);
  String path = tool.getPath();

  StorageRecovery storageRecovery = new StorageRecovery(config, path);
  storageRecovery.run();
 }
}
origin: org.apache.samza/samza-core_2.11

private boolean isValidSideInputStore(String storeName, File storeLocation) {
 return isPersistedStore(storeName)
   && !StorageManagerUtil.isStaleStore(storeLocation, OFFSET_FILE, STORE_DELETE_RETENTION_MS, clock.currentTimeMillis())
   && StorageManagerUtil.isOffsetFileValid(storeLocation, OFFSET_FILE);
}
origin: org.apache.samza/samza-api

 public StoreProperties build() {
  return new StoreProperties(persistedToDisk, loggedStore);
 }
}
origin: org.apache.samza/samza-core_2.10

 public static void main(String[] args) {
  StateStorageTool tool = new StateStorageTool();
  OptionSet options = tool.parser().parse(args);
  MapConfig config = tool.loadConfig(options);
  String path = tool.getPath();

  StorageRecovery storageRecovery = new StorageRecovery(config, path);
  storageRecovery.run();
 }
}
origin: org.apache.samza/samza-core

private boolean isValidSideInputStore(String storeName, File storeLocation) {
 return isPersistedStore(storeName)
   && !StorageManagerUtil.isStaleStore(storeLocation, OFFSET_FILE, STORE_DELETE_RETENTION_MS, clock.currentTimeMillis())
   && StorageManagerUtil.isOffsetFileValid(storeLocation, OFFSET_FILE);
}
origin: org.apache.samza/samza-core_2.12

 public static void main(String[] args) {
  StateStorageTool tool = new StateStorageTool();
  OptionSet options = tool.parser().parse(args);
  MapConfig config = tool.loadConfig(options);
  String path = tool.getPath();

  StorageRecovery storageRecovery = new StorageRecovery(config, path);
  storageRecovery.run();
 }
}
origin: org.apache.samza/samza-core_2.10

private boolean isValidSideInputStore(String storeName, File storeLocation) {
 return isPersistedStore(storeName)
   && !StorageManagerUtil.isStaleStore(storeLocation, OFFSET_FILE, STORE_DELETE_RETENTION_MS, clock.currentTimeMillis())
   && StorageManagerUtil.isOffsetFileValid(storeLocation, OFFSET_FILE);
}
origin: org.apache.samza/samza-core_2.11

 public static void main(String[] args) {
  StateStorageTool tool = new StateStorageTool();
  OptionSet options = tool.parser().parse(args);
  MapConfig config = tool.loadConfig(options);
  String path = tool.getPath();

  StorageRecovery storageRecovery = new StorageRecovery(config, path);
  storageRecovery.run();
 }
}
origin: org.apache.samza/samza-core_2.12

private boolean isValidSideInputStore(String storeName, File storeLocation) {
 return isPersistedStore(storeName)
   && !StorageManagerUtil.isStaleStore(storeLocation, OFFSET_FILE, STORE_DELETE_RETENTION_MS, clock.currentTimeMillis())
   && StorageManagerUtil.isOffsetFileValid(storeLocation, OFFSET_FILE);
}
org.apache.samza.storage

Most used classes

  • Entry
    A key and value.
  • KeyValueStore
    A key-value store that supports put, get, delete, and range queries.
  • ChangelogStreamManager
    The Changelog manager creates the changelog stream. If a coordinator stream manager is provided, it
  • StorageManagerUtil
  • StoreProperties
    Immutable class that defines the properties of a Store
  • RocksDbTableDescriptor,
  • StorageEngine,
  • StorageEngineFactory,
  • StorageRecovery,
  • TaskSideInputStorageManager,
  • ClosableIterator,
  • SideInputsProcessor,
  • StateStorageTool,
  • TaskStorageManager,
  • RocksDbKeyValueReader,
  • RocksDbOptionsHelper,
  • RocksDbReadingTool,
  • BaseLocalStoreBackedTableDescriptor,
  • ContainerStorageManager
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