@Override public void start(CoprocessorEnvironment e) throws IOException { // this only makes sure that leases and locks are available to coprocessors // from external packages RegionCoprocessorEnvironment re = (RegionCoprocessorEnvironment)e; Leases leases = re.getRegionServerServices().getLeases(); leases.createLease(re.getRegion().getRegionInfo().getRegionNameAsString(), 2000, null); leases.cancelLease(re.getRegion().getRegionInfo().getRegionNameAsString()); }
@Override public void start(CoprocessorEnvironment e) throws IOException { // this only makes sure that leases and locks are available to coprocessors // from external packages RegionCoprocessorEnvironment re = (RegionCoprocessorEnvironment)e; Leases leases = re.getRegionServerServices().getLeases(); leases.createLease("x", null); leases.cancelLease("x"); }
@Override public void start(CoprocessorEnvironment e) throws IOException { // this only makes sure that leases and locks are available to coprocessors // from external packages RegionCoprocessorEnvironment re = (RegionCoprocessorEnvironment)e; Leases leases = re.getRegionServerServices().getLeases(); leases.createLease(re.getRegion().getRegionNameAsString(), 2000, null); leases.cancelLease(re.getRegion().getRegionNameAsString()); }
@Override public void start(CoprocessorEnvironment e) throws IOException { // this only makes sure that leases and locks are available to coprocessors // from external packages RegionCoprocessorEnvironment re = (RegionCoprocessorEnvironment)e; Leases leases = re.getRegionServerServices().getLeases(); leases.createLease("x", 2000, null); leases.cancelLease("x"); }
@Override public void start(CoprocessorEnvironment e) throws IOException { // this only makes sure that leases and locks are available to coprocessors // from external packages RegionCoprocessorEnvironment re = (RegionCoprocessorEnvironment)e; Leases leases = re.getRegionServerServices().getLeases(); leases.createLease("x", 2000, null); leases.cancelLease("x"); Integer lid = re.getRegion().getLock(null, Bytes.toBytes("some row"), true); re.getRegion().releaseRowLock(lid); }
/** * @param conf * @throws IOException */ public TransactionalRegionServer(final Configuration conf) throws IOException, InterruptedException { super(conf); this.getRpcMetrics().createMetrics( new Class<?>[] { TransactionalRegionInterface.class }); cleanOldTransactionsThread = new CleanOldTransactionsChore(this); transactionLeases = new Leases(conf.getInt(LEASE_TIME, DEFAULT_LEASE_TIME), LEASE_CHECK_FREQUENCY); LOG.info("Transaction lease time: " + conf.getInt(LEASE_TIME, DEFAULT_LEASE_TIME)); }
@Override public Leases getLeases() { // TODO Auto-generated method stub return null; }
@Override public Leases getLeases() { return null; }
public void setTransactionalLeases(final Leases transactionalLeases) { this.transactionLeases = transactionalLeases; }
protected Leases getTransactionalLeases() { return this.transactionLeases; }