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(); }
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); } }
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 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); } }
@Override public boolean testClassLoad(final String namespace, final String className, final String asTypeName) throws NamespaceNotFoundException, AccumuloException, AccumuloSecurityException { checkArgument(namespace != null, "namespace is null"); checkArgument(className != null, "className is null"); checkArgument(asTypeName != null, "asTypeName is null"); try { return ServerClient.executeRaw(context, client -> client.checkNamespaceClass(Tracer.traceInfo(), context.rpcCreds(), namespace, className, asTypeName)); } catch (ThriftTableOperationException e) { switch (e.getType()) { case NAMESPACE_NOTFOUND: throw new NamespaceNotFoundException(e); default: throw new AccumuloException(e.description, e); } } 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 boolean testClassLoad(final String tableName, final String className, final String asTypeName) throws TableNotFoundException, AccumuloException, AccumuloSecurityException { checkArgument(tableName != null, "tableName is null"); checkArgument(className != null, "className is null"); checkArgument(asTypeName != null, "asTypeName is null"); try { return ServerClient.executeRaw(context, client -> client.checkTableClass(Tracer.traceInfo(), context.rpcCreds(), tableName, className, asTypeName)); } catch (ThriftTableOperationException e) { switch (e.getType()) { case NOTFOUND: throw new TableNotFoundException(e); case NAMESPACE_NOTFOUND: throw new TableNotFoundException(tableName, new NamespaceNotFoundException(e)); default: throw new AccumuloException(e.description, e); } } 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 Iterable<Entry<String,String>> getProperties(final String tableName) throws AccumuloException, TableNotFoundException { checkArgument(tableName != null, "tableName is null"); try { return ServerClient.executeRaw(context, client -> client.getTableConfiguration(Tracer.traceInfo(), context.rpcCreds(), tableName)) .entrySet(); } catch (ThriftTableOperationException e) { switch (e.getType()) { case NOTFOUND: throw new TableNotFoundException(e); case NAMESPACE_NOTFOUND: throw new TableNotFoundException(tableName, new NamespaceNotFoundException(e)); default: throw new AccumuloException(e.description, e); } } catch (AccumuloException e) { throw e; } catch (Exception e) { throw new AccumuloException(e); } }
diskUsages = pair.getSecond().getDiskUsage(tableNames, context.rpcCreds()); } catch (ThriftTableOperationException e) { switch (e.getType()) { case NOTFOUND: throw new TableNotFoundException(e);
throw e; } catch (ThriftTableOperationException e) { switch (e.getType()) { case NAMESPACE_NOTFOUND: throw new TableNotFoundException(e.getTableName(), new NamespaceNotFoundException(e));
throw e; } catch (ThriftTableOperationException e) { switch (e.getType()) { case NAMESPACE_NOTFOUND: throw new TableNotFoundException(e.getTableName(), new NamespaceNotFoundException(e));
switch (e.getType()) { case NOTFOUND: throw new TableNotFoundException(e);
switch (e.getType()) { case EXISTS: throw new TableExistsException(e);