/** * Initialize the state storage * * @param conf the configuration * @throws IOException */ @Override public void serviceInit(Configuration conf) throws IOException { initStorage(conf); }
/** * Start the state storage for use * * @throws IOException */ @Override public void serviceStart() throws IOException { startStorage(); }
/** * Shutdown the state storage. * * @throws IOException */ @Override public void serviceStop() throws IOException { closeStorage(); }
@Override public TimelineServiceState loadState() throws IOException { LOG.info("Loading timeline service state from leveldb"); TimelineServiceState state = new TimelineServiceState(); int numKeys = loadTokenMasterKeys(state); int numTokens = loadTokens(state); loadLatestSequenceNumber(state); LOG.info("Loaded " + numKeys + " master keys and " + numTokens + " tokens from leveldb, and latest sequence number is " + state.getLatestSequenceNumber()); return state; }
private LeveldbTimelineStateStore initAndStartTimelineServiceStateStoreService() { store = new LeveldbTimelineStateStore(); store.init(conf); store.start(); return (LeveldbTimelineStateStore) store; }
@Override protected void startStorage() throws IOException { state = new TimelineServiceState(); }
@Override protected void serviceStop() throws Exception { if (stateStore != null) { stateStore.stop(); } super.serviceStop(); }
@Override public TimelineServiceState loadState() throws IOException { LOG.info("Loading timeline service state from leveldb"); TimelineServiceState state = new TimelineServiceState(); int numKeys = loadTokenMasterKeys(state); int numTokens = loadTokens(state); loadLatestSequenceNumber(state); LOG.info("Loaded " + numKeys + " master keys and " + numTokens + " tokens from leveldb, and latest sequence number is " + state.getLatestSequenceNumber()); return state; }
@Override protected void startStorage() throws IOException { state = new TimelineServiceState(); }
/** * Initialize the state storage * * @param conf the configuration * @throws IOException */ @Override public void serviceInit(Configuration conf) throws IOException { initStorage(conf); }
/** * Start the state storage for use * * @throws IOException */ @Override public void serviceStart() throws IOException { startStorage(); }
/** * Shutdown the state storage. * * @throws IOException */ @Override public void serviceStop() throws IOException { closeStorage(); }
@Override public TimelineServiceState loadState() throws IOException { LOG.info("Loading timeline service state from leveldb"); TimelineServiceState state = new TimelineServiceState(); int numKeys = loadTokenMasterKeys(state); int numTokens = loadTokens(state); loadLatestSequenceNumber(state); LOG.info("Loaded " + numKeys + " master keys and " + numTokens + " tokens from leveldb, and latest sequence number is " + state.getLatestSequenceNumber()); return state; }
@Override protected void startStorage() throws IOException { state = new TimelineServiceState(); }
/** * Initialize the state storage * * @param conf the configuration * @throws IOException */ @Override public void serviceInit(Configuration conf) throws IOException { initStorage(conf); }
/** * Start the state storage for use * * @throws IOException */ @Override public void serviceStart() throws IOException { startStorage(); }
/** * Shutdown the state storage. * * @throws IOException */ @Override public void serviceStop() throws IOException { closeStorage(); }
@Override public TimelineServiceState loadState() throws IOException { TimelineServiceState result = new TimelineServiceState(); result.tokenState.putAll(state.tokenState); result.tokenMasterKeyState.addAll(state.tokenMasterKeyState); result.latestSequenceNumber = state.latestSequenceNumber; return result; }
@Override public TimelineServiceState loadState() throws IOException { TimelineServiceState result = new TimelineServiceState(); result.tokenState.putAll(state.tokenState); result.tokenMasterKeyState.addAll(state.tokenMasterKeyState); result.latestSequenceNumber = state.latestSequenceNumber; return result; }