public ThriftTableOperationException deepCopy() { return new ThriftTableOperationException(this); }
public static Table.ID checkTableId(ClientContext context, String tableName, TableOperation operation) throws ThriftTableOperationException { TableOperationExceptionType reason = null; try { return Tables._getTableId(context, tableName); } catch (NamespaceNotFoundException e) { reason = TableOperationExceptionType.NAMESPACE_NOTFOUND; } catch (TableNotFoundException e) { reason = TableOperationExceptionType.NOTFOUND; } throw new ThriftTableOperationException(null, tableName, operation, reason, null); }
private <T> T _validateArgument(T arg, TableOperation op, Validator<T> validator) throws ThriftTableOperationException { try { return validator.validate(arg); } catch (IllegalArgumentException e) { String why = e.getMessage(); // Information provided by a client should generate a user-level exception, not a system-level // warning. log.debug(why); throw new ThriftTableOperationException(null, String.valueOf(arg), op, TableOperationExceptionType.INVALID_NAME, why); } }
private Table.ID validateTableIdArgument(ByteBuffer tableIdArg, TableOperation op, Validator<Table.ID> userValidator) throws ThriftTableOperationException { Table.ID tableId = tableIdArg == null ? null : ByteBufferUtil.toTableId(tableIdArg); try { return VALID_ID.and(userValidator).validate(tableId); } catch (IllegalArgumentException e) { String why = e.getMessage(); // Information provided by a client should generate a user-level exception, not a system-level // warning. log.debug(why); throw new ThriftTableOperationException(tableId.canonicalID(), null, op, TableOperationExceptionType.INVALID_NAME, why); } }
public static Namespace.ID checkNamespaceId(ClientContext context, String namespaceName, TableOperation operation) throws ThriftTableOperationException { Namespace.ID namespaceId = Namespaces.lookupNamespaceId(context, namespaceName); if (namespaceId == null) { // maybe the namespace exists, but the cache was not updated yet... so try to clear the cache // and check again Tables.clearCache(context); namespaceId = Namespaces.lookupNamespaceId(context, namespaceName); if (namespaceId == null) throw new ThriftTableOperationException(null, namespaceName, operation, TableOperationExceptionType.NAMESPACE_NOTFOUND, null); } return namespaceId; }
public void mustBeOnline(final Table.ID tableId) throws ThriftTableOperationException { Tables.clearCache(context); if (!Tables.getTableState(context, tableId).equals(TableState.ONLINE)) throw new ThriftTableOperationException(tableId.canonicalID(), null, TableOperation.MERGE, TableOperationExceptionType.OFFLINE, "table is not online"); }
private Namespace.ID getNamespaceIdFromTableId(TableOperation tableOp, Table.ID tableId) throws ThriftTableOperationException { Namespace.ID namespaceId; try { namespaceId = Tables.getNamespaceId(master.getContext(), tableId); } catch (TableNotFoundException e) { throw new ThriftTableOperationException(tableId.canonicalID(), null, tableOp, TableOperationExceptionType.NOTFOUND, e.getMessage()); } return namespaceId; }
private Namespace.ID getNamespaceIdFromTableId(TableOperation tableOp, Table.ID tableId) throws ThriftTableOperationException { Namespace.ID namespaceId; try { namespaceId = Tables.getNamespaceId(master.getContext(), tableId); } catch (TableNotFoundException e) { throw new ThriftTableOperationException(tableId.canonicalID(), null, tableOp, TableOperationExceptionType.NOTFOUND, e.getMessage()); } return namespaceId; }
@Override public Map<String,String> getNamespaceConfiguration(TInfo tinfo, TCredentials credentials, String ns) throws ThriftTableOperationException, TException { Namespace.ID namespaceId; try { namespaceId = Namespaces.getNamespaceId(context, ns); } catch (NamespaceNotFoundException e) { String why = "Could not find namespace while getting configuration."; throw new ThriftTableOperationException(null, ns, null, TableOperationExceptionType.NAMESPACE_NOTFOUND, why); } AccumuloConfiguration config = context.getServerConfFactory() .getNamespaceConfiguration(namespaceId); return conf(credentials, config); }
/** * Performs a deep copy on <i>other</i>. */ public waitForFlush_result(waitForFlush_result other) { if (other.isSetSec()) { this.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(other.sec); } if (other.isSetTope()) { this.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(other.tope); } if (other.isSetTnase()) { this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, setNamespaceProperty_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(); struct.sec.read(iprot); struct.setSecIsSet(true); } if (incoming.get(1)) { struct.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(); struct.tope.read(iprot); struct.setTopeIsSet(true); } if (incoming.get(2)) { struct.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(); struct.tnase.read(iprot); struct.setTnaseIsSet(true); } } }
/** * Performs a deep copy on <i>other</i>. */ public executeFateOperation_result(executeFateOperation_result other) { if (other.isSetSec()) { this.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(other.sec); } if (other.isSetTope()) { this.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(other.tope); } if (other.isSetTnase()) { this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); } }
/** * Performs a deep copy on <i>other</i>. */ public setTableProperty_result(setTableProperty_result other) { if (other.isSetSec()) { this.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(other.sec); } if (other.isSetTope()) { this.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(other.tope); } if (other.isSetTnase()) { this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); } }
/** * Performs a deep copy on <i>other</i>. */ public setNamespaceProperty_result(setNamespaceProperty_result other) { if (other.isSetSec()) { this.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(other.sec); } if (other.isSetTope()) { this.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(other.tope); } if (other.isSetTnase()) { this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); } }
/** * Performs a deep copy on <i>other</i>. */ public removeNamespaceProperty_result(removeNamespaceProperty_result other) { if (other.isSetSec()) { this.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(other.sec); } if (other.isSetTope()) { this.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(other.tope); } if (other.isSetTnase()) { this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, setTableProperty_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(); struct.sec.read(iprot); struct.setSecIsSet(true); } if (incoming.get(1)) { struct.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(); struct.tope.read(iprot); struct.setTopeIsSet(true); } if (incoming.get(2)) { struct.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(); struct.tnase.read(iprot); struct.setTnaseIsSet(true); } } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, removeTableProperty_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(); struct.sec.read(iprot); struct.setSecIsSet(true); } if (incoming.get(1)) { struct.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(); struct.tope.read(iprot); struct.setTopeIsSet(true); } if (incoming.get(2)) { struct.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(); struct.tnase.read(iprot); struct.setTnaseIsSet(true); } } }
/** * Performs a deep copy on <i>other</i>. */ public removeTableProperty_result(removeTableProperty_result other) { if (other.isSetSec()) { this.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(other.sec); } if (other.isSetTope()) { this.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(other.tope); } if (other.isSetTnase()) { this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); } }
/** * Performs a deep copy on <i>other</i>. */ public initiateFlush_result(initiateFlush_result other) { __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetSec()) { this.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(other.sec); } if (other.isSetTope()) { this.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(other.tope); } if (other.isSetTnase()) { this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); } }
/** * Performs a deep copy on <i>other</i>. */ public waitForFateOperation_result(waitForFateOperation_result other) { if (other.isSetSuccess()) { this.success = other.success; } if (other.isSetSec()) { this.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException(other.sec); } if (other.isSetTope()) { this.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(other.tope); } if (other.isSetTnase()) { this.tnase = new org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException(other.tnase); } }