@Override public void shutdown() { super.shutdown(); MetricsCoprocessor.removeRegistry(this.metricRegistry); } }
/** * Do not call with an observerOperation that is null! Have the caller check. */ protected <O, R> R execOperationWithResult( final ObserverOperationWithResult<O, R> observerOperation) throws IOException { boolean bypass = execOperation(observerOperation); R result = observerOperation.getResult(); return bypass == observerOperation.isBypassable()? result: null; }
private void tableMetricRegisterAndMark(ObserverContext<RegionCoprocessorEnvironment> e, Row op) { // Mark the meta table meter whenever the coprocessor is called String tableName = getTableNameFromOp(op); String tableRequestMeter = tableMeterName(tableName); registerMeterIfNotPresent(e, tableRequestMeter); markMeterIfPresent(tableRequestMeter); }
@Override public void start(CoprocessorEnvironment env) throws IOException { if (env instanceof RegionCoprocessorEnvironment) { this.env = (RegionCoprocessorEnvironment)env; return; } throw new CoprocessorException("Must be loaded on a table region!"); }
@Override public void call(MasterObserver observer) throws IOException { observer.postDeleteTable(this, tableName); } });
@Override public void call(MasterObserver observer) throws IOException { observer.preEnableTable(this, tableName); } });
@Override public void call(MasterObserver observer) throws IOException { observer.preDisableTable(this, tableName); } });
@Override public void call(MasterObserver observer) throws IOException { observer.postDisableTable(this, tableName); } });
@Override public void call(MasterObserver observer) throws IOException { observer.postAssign(this, regionInfo); } });
@Override public void call(MasterObserver observer) throws IOException { observer.preBalance(this); } });
/** * Called prior to modifying a namespace's properties. * @param ctx the environment to interact with the framework and master * @param currentNsDescriptor current NamespaceDescriptor of the namespace * @param newNsDescriptor after modify operation, namespace will have this descriptor */ default void preModifyNamespace(final ObserverContext<MasterCoprocessorEnvironment> ctx, NamespaceDescriptor currentNsDescriptor, NamespaceDescriptor newNsDescriptor) throws IOException { preModifyNamespace(ctx, newNsDescriptor); }
@Override public void call(MasterObserver observer) throws IOException { observer.postGetTableNames(this, descriptors, regex); } });
@Override public void call(MasterObserver observer) throws IOException { observer.preSplitRegionAction(this, tableName, splitRow); } });
@Override public void call(MasterObserver observer) throws IOException { observer.postRemoveRSGroup(this, name); } });
@Override public void call(MasterObserver observer) throws IOException { observer.preListReplicationPeers(this, regex); } });
@Override public void call(MasterObserver observer) throws IOException { observer.preGrant(this, userPermission, mergeExistingPermissions); } });
@Override public void start(CoprocessorEnvironment env) throws IOException { if (env instanceof RegionCoprocessorEnvironment) { this.env = (RegionCoprocessorEnvironment)env; return; } throw new CoprocessorException("Must be loaded on a table region!"); }
@Override public void shutdown() { super.shutdown(); MetricsCoprocessor.removeRegistry(metricRegistry); } }
@Override public void shutdown() { super.shutdown(); MetricsCoprocessor.removeRegistry(this.metricRegistry); }
@Override public void shutdown() { super.shutdown(); MetricsCoprocessor.removeRegistry(this.metricRegistry); } }