public ThriftTableOperationException deepCopy() { return new ThriftTableOperationException(this); }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ThriftTableOperationException) return this.equals((ThriftTableOperationException)that); return false; }
public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TABLE_ID: return getTableId(); case TABLE_NAME: return getTableName(); case OP: return getOp(); case TYPE: return getType(); case DESCRIPTION: return getDescription(); } throw new java.lang.IllegalStateException(); }
/** * @param e * constructs an exception from a thrift exception */ public TableExistsException(ThriftTableOperationException e) { this(e.getTableId(), e.getTableName(), e.getDescription(), e); } }
@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); } } }
throw e; } catch (ThriftTableOperationException e) { switch (e.getType()) { case NAMESPACE_NOTFOUND: throw new TableNotFoundException(e.getTableName(), new NamespaceNotFoundException(e)); case NOTFOUND: throw new TableNotFoundException(e);
private void executeVoid(ClientExec<ClientService.Client> exec) throws AccumuloException, AccumuloSecurityException { try { ServerClient.executeRawVoid(context, exec); } catch (ThriftTableOperationException ttoe) { // recast missing table if (ttoe.getType() == TableOperationExceptionType.NOTFOUND) throw new AccumuloSecurityException(null, SecurityErrorCode.TABLE_DOESNT_EXIST); else if (ttoe.getType() == TableOperationExceptionType.NAMESPACE_NOTFOUND) throw new AccumuloSecurityException(null, SecurityErrorCode.NAMESPACE_DOESNT_EXIST); else throw new AccumuloException(ttoe); } catch (ThriftSecurityException e) { throw new AccumuloSecurityException(e.user, e.code, e); } catch (AccumuloException e) { throw e; } catch (Exception e) { throw new AccumuloException(e); } }
@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); } } }
/** * @param e * constructs an exception from a thrift exception */ public NamespaceNotFoundException(ThriftTableOperationException e) { this(e.getTableId(), e.getTableName(), e.getDescription(), e); }
throw e; } catch (ThriftTableOperationException e) { switch (e.getType()) { case NAMESPACE_NOTFOUND: throw new TableNotFoundException(e.getTableName(), new NamespaceNotFoundException(e)); case NOTFOUND: throw new TableNotFoundException(e);
private <T> T execute(ClientExecReturn<T,ClientService.Client> exec) throws AccumuloException, AccumuloSecurityException { try { return ServerClient.executeRaw(context, exec); } catch (ThriftTableOperationException ttoe) { // recast missing table if (ttoe.getType() == TableOperationExceptionType.NOTFOUND) throw new AccumuloSecurityException(null, SecurityErrorCode.TABLE_DOESNT_EXIST); else if (ttoe.getType() == TableOperationExceptionType.NAMESPACE_NOTFOUND) throw new AccumuloSecurityException(null, SecurityErrorCode.NAMESPACE_DOESNT_EXIST); else throw new AccumuloException(ttoe); } catch (ThriftSecurityException e) { throw new AccumuloSecurityException(e.user, e.code, e); } catch (AccumuloException e) { throw e; } catch (Exception e) { throw new AccumuloException(e); } }
@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); } } }
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); }
/** * @param e * constructs an exception from a thrift exception */ public NamespaceExistsException(ThriftTableOperationException e) { this(e.getTableId(), e.getTableName(), e.getDescription(), e); } }
diskUsages = pair.getSecond().getDiskUsage(tableNames, context.rpcCreds()); } catch (ThriftTableOperationException e) { switch (e.getType()) { case NOTFOUND: throw new TableNotFoundException(e); case NAMESPACE_NOTFOUND: throw new TableNotFoundException(e.getTableName(), new NamespaceNotFoundException(e)); default: throw new AccumuloException(e.description, e);
if (!(this_present_tope && that_present_tope)) return false; if (!this.tope.equals(that.tope)) return false;
@Override public Iterable<Entry<String,String>> getProperties(final String namespace) throws AccumuloException, NamespaceNotFoundException { checkArgument(namespace != null, "namespace is null"); try { return ServerClient.executeRaw(context, client -> client .getNamespaceConfiguration(Tracer.traceInfo(), context.rpcCreds(), namespace)).entrySet(); } catch (ThriftTableOperationException e) { switch (e.getType()) { case NAMESPACE_NOTFOUND: throw new NamespaceNotFoundException(e); case OTHER: default: throw new AccumuloException(e.description, e); } } catch (AccumuloException e) { throw e; } catch (Exception e) { throw new AccumuloException(e); } }
case 2: // TOPE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException(); struct.tope.read(iprot); struct.setTopeIsSet(true); } else {
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); } }
/** * @param e * constructs an exception from a thrift exception */ public TableNotFoundException(ThriftTableOperationException e) { this(e.getTableId(), e.getTableName(), e.getDescription(), e); }