@Override public void init(final ProcessorContext context, final StateStore root) { innerState.init(context, root); }
@Override public void init(ProcessorContext context, StateStore root) { innerState.init(context, root); }
@Override public Set<String> initialize() { try { if (!stateDirectory.lockGlobalState()) { throw new LockException(String.format("Failed to lock the global state directory: %s", baseDir)); } } catch (final IOException e) { throw new LockException(String.format("Failed to lock the global state directory: %s", baseDir)); } try { this.checkpointableOffsets.putAll(checkpoint.read()); } catch (final IOException e) { try { stateDirectory.unlockGlobalState(); } catch (final IOException e1) { log.error("Failed to unlock the global state directory", e); } throw new StreamsException("Failed to read checkpoints for global state globalStores", e); } final List<StateStore> stateStores = topology.globalStateStores(); for (final StateStore stateStore : stateStores) { globalStoreNames.add(stateStore.name()); stateStore.init(processorContext, stateStore); } return Collections.unmodifiableSet(globalStoreNames); }
stateStore.init(processorContext, stateStore);
/** * Package-private for testing only * * @throws StreamsException If the store's change log does not contain the partition */ void registerStateStores() { if (topology.stateStores().isEmpty()) { return; } try { if (!stateDirectory.lock(id)) { throw new LockException(String.format("%sFailed to lock the state directory for task %s", logPrefix, id)); } } catch (final IOException e) { throw new StreamsException( String.format("%sFatal error while trying to lock the state directory for task %s", logPrefix, id)); } log.trace("Initializing state stores"); // set initial offset limits updateOffsetLimits(); for (final StateStore store : topology.stateStores()) { log.trace("Initializing store {}", store.name()); processorContext.uninitialize(); store.init(processorContext, store); } }