public void preWALWrite(final RegionInfo info, final WALKey logKey, final WALEdit logEdit) throws IOException { // Not bypassable. if (this.coprocEnvironments.isEmpty()) { return; } execOperation(new WALObserverOperation() { @Override public void call(WALObserver oserver) throws IOException { oserver.preWALWrite(this, info, logKey, logEdit); } }); }
public void postWALWrite(final RegionInfo info, final WALKey logKey, final WALEdit logEdit) throws IOException { execOperation(coprocEnvironments.isEmpty() ? null : new WALObserverOperation() { @Override protected void call(WALObserver observer) throws IOException { observer.postWALWrite(this, info, logKey, logEdit); } }); }
/** * Called before rolling the current WAL * @param oldPath the path of the current wal that we are replacing * @param newPath the path of the wal we are going to create */ public void preWALRoll(Path oldPath, Path newPath) throws IOException { execOperation(coprocEnvironments.isEmpty() ? null : new WALObserverOperation() { @Override protected void call(WALObserver observer) throws IOException { observer.preWALRoll(this, oldPath, newPath); } }); }
/** * Called after rolling the current WAL * @param oldPath the path of the wal that we replaced * @param newPath the path of the wal we have created and now is the current */ public void postWALRoll(Path oldPath, Path newPath) throws IOException { execOperation(coprocEnvironments.isEmpty() ? null : new WALObserverOperation() { @Override protected void call(WALObserver observer) throws IOException { observer.postWALRoll(this, oldPath, newPath); } }); }
@Override public Optional<WALObserver> getWALObserver() { return Optional.of(this); }