@Override public synchronized boolean isProcedureDone(ProcedureDescription desc) throws IOException { // Procedure instance name is the table name. TableName tableName = TableName.valueOf(desc.getInstance()); Procedure proc = procMap.get(tableName); if (proc == null) { // The procedure has not even been started yet. // The client would request the procedure and call isProcedureDone(). // The HBaseAdmin.execProcedure() wraps both request and isProcedureDone(). return false; } // We reply on the existing Distributed Procedure framework to give us the status. return proc.isCompleted(); }
ForeignExceptionDispatcher monitor = new ForeignExceptionDispatcher(desc.getInstance()); List<ServerName> serverNames = master.getServerManager().getOnlineServersList(); List<String> servers = new ArrayList<>(); Procedure proc = coordinator.startProcedure(monitor, desc.getInstance(), data, servers); if (proc == null) { String msg = "Failed to submit distributed procedure for '" + desc.getInstance() + "'"; LOG.error(msg); throw new IOException(msg); LOG.info("Done waiting - exec procedure for " + desc.getInstance()); LOG.info("Distributed roll log procedure is successful!"); this.done = true;
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasSignature()) { hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; hash = (53 * hash) + getSignature().hashCode(); } if (hasInstance()) { hash = (37 * hash) + INSTANCE_FIELD_NUMBER; hash = (53 * hash) + getInstance().hashCode(); } if (hasCreationTime()) { hash = (37 * hash) + CREATION_TIME_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashLong( getCreationTime()); } if (getConfigurationCount() > 0) { hash = (37 * hash) + CONFIGURATION_FIELD_NUMBER; hash = (53 * hash) + getConfigurationList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
this.done = false; ForeignExceptionDispatcher monitor = new ForeignExceptionDispatcher(desc.getInstance()); servers.add(sn.toString()); Procedure proc = coordinator.startProcedure(monitor, desc.getInstance(), new byte[0], servers); if (proc == null) { String msg = "Failed to submit distributed procedure for '" LOG.info("Done waiting - exec procedure for " + desc.getInstance()); this.done = true; } catch (InterruptedException e) {
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription)) { return super.equals(obj); } org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription other = (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription) obj; boolean result = true; result = result && (hasSignature() == other.hasSignature()); if (hasSignature()) { result = result && getSignature() .equals(other.getSignature()); } result = result && (hasInstance() == other.hasInstance()); if (hasInstance()) { result = result && getInstance() .equals(other.getInstance()); } result = result && (hasCreationTime() == other.hasCreationTime()); if (hasCreationTime()) { result = result && (getCreationTime() == other.getCreationTime()); } result = result && getConfigurationList() .equals(other.getConfigurationList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasSignature()) { hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; hash = (53 * hash) + getSignature().hashCode(); } if (hasInstance()) { hash = (37 * hash) + INSTANCE_FIELD_NUMBER; hash = (53 * hash) + getInstance().hashCode(); } if (hasCreationTime()) { hash = (37 * hash) + CREATION_TIME_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashLong( getCreationTime()); } if (getConfigurationCount() > 0) { hash = (37 * hash) + CONFIGURATION_FIELD_NUMBER; hash = (53 * hash) + getConfigurationList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * <pre> * the procedure instance name * </pre> * * <code>optional string instance = 2;</code> */ public Builder clearInstance() { bitField0_ = (bitField0_ & ~0x00000002); instance_ = getDefaultInstance().getInstance(); onChanged(); return this; } /**
@Override public void execProcedure(ProcedureDescription desc) throws IOException { TableName tableName = TableName.valueOf(desc.getInstance()); ForeignExceptionDispatcher monitor = new ForeignExceptionDispatcher(desc.getInstance()); Procedure proc = coordinator.startProcedure(monitor, desc.getInstance(), new byte[0], Lists.newArrayList(regionServers)); monitor.rethrowException(); if (proc == null) { String msg = "Failed to submit distributed procedure " + desc.getSignature() + " for '" + desc.getInstance() + "'. " + "Another flush procedure is running?"; LOG.error(msg); throw new IOException(msg); + desc.getInstance() + "'"); LOG.info("Master flush table procedure is successful!"); } catch (InterruptedException e) {
this.done = false; ForeignExceptionDispatcher monitor = new ForeignExceptionDispatcher(desc.getInstance()); servers.add(sn.toString()); Procedure proc = coordinator.startProcedure(monitor, desc.getInstance(), new byte[0], servers); if (proc == null) { String msg = "Failed to submit distributed procedure for '" LOG.info("Done waiting - exec procedure for " + desc.getInstance()); this.done = true; } catch (InterruptedException e) {
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription)) { return super.equals(obj); } org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription other = (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ProcedureDescription) obj; boolean result = true; result = result && (hasSignature() == other.hasSignature()); if (hasSignature()) { result = result && getSignature() .equals(other.getSignature()); } result = result && (hasInstance() == other.hasInstance()); if (hasInstance()) { result = result && getInstance() .equals(other.getInstance()); } result = result && (hasCreationTime() == other.hasCreationTime()); if (hasCreationTime()) { result = result && (getCreationTime() == other.getCreationTime()); } result = result && getConfigurationList() .equals(other.getConfigurationList()); result = result && unknownFields.equals(other.unknownFields); return result; }
private SnapshotDescription toSnapshotDescription(ProcedureDescription desc) throws IOException { SnapshotDescription.Builder builder = SnapshotDescription.newBuilder(); if (!desc.hasInstance()) { throw new IOException("Snapshot name is not defined: " + desc.toString()); } String snapshotName = desc.getInstance(); List<NameStringPair> props = desc.getConfigurationList(); String table = null; for (NameStringPair prop : props) { if ("table".equalsIgnoreCase(prop.getName())) { table = prop.getValue(); } } if (table == null) { throw new IOException("Snapshot table is not defined: " + desc.toString()); } TableName tableName = TableName.valueOf(table); builder.setTable(tableName.getNameAsString()); builder.setName(snapshotName); builder.setType(SnapshotDescription.Type.FLUSH); return builder.build(); } }
/** * <pre> * the procedure instance name * </pre> * * <code>optional string instance = 2;</code> */ public Builder clearInstance() { bitField0_ = (bitField0_ & ~0x00000002); instance_ = getDefaultInstance().getInstance(); onChanged(); return this; } /**