@Override public void closeNonForwardQuery(QueryId queryId) { try { ensureOk(conn.getTMStub().closeNonForwardQuery(null, buildQueryIdRequest(queryId))); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public List<TableDescriptorProto> getAllTables() { try { final BlockingInterface stub = getStub(); final GetTablesResponse response = stub.getAllTables(null, ProtoUtil.NULL_PROTO); ensureOk(response.getState()); return response.getTableList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public List<TableStatsProto> getAllTableStats() { try { final BlockingInterface stub = getStub(); final GetTableStatsResponse response = stub.getAllTableStats(null, ProtoUtil.NULL_PROTO); ensureOk(response.getState()); return response.getStatsList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public List<TablespaceProto> getAllTablespaces() { try { final BlockingInterface stub = getStub(); final GetTablespaceListResponse response = stub.getAllTablespaces(null, ProtoUtil.NULL_PROTO); ensureOk(response.getState()); return response.getTablespaceList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public List<DatabaseProto> getAllDatabases() { try { final BlockingInterface stub = getStub(); final GetDatabasesResponse response = stub.getAllDatabases(null, ProtoUtil.NULL_PROTO); ensureOk(response.getState()); return response.getDatabaseList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final void createFunction(final FunctionDesc funcDesc) throws DuplicateFunctionException { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.createFunction(null, funcDesc.getProto()); throwsIfThisError(state, DuplicateFunctionException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }
public void selectDatabase(final String dbName) throws UndefinedDatabaseException { try { final BlockingInterface stub = getTMStub(); final ReturnState state = stub.selectDatabase(null, getSessionedString(dbName)); ExceptionUtil.throwsIfThisError(state, UndefinedDatabaseException.class); ensureOk(state); this.baseDatabase = dbName; } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public List<BriefQueryInfo> getFinishedQueryList() { final BlockingInterface stub = conn.getTMStub(); GetQueryListResponse res; try { res = stub.getFinishedQueryList(null, conn.sessionId); } catch (ServiceException e) { throw new RuntimeException(e); } ensureOk(res.getState()); return res.getQueryListList(); }
@Override public List<TablespaceProto> getAllTablespaces() { try { final BlockingInterface stub = getStub(); final GetTablespaceListResponse response = stub.getAllTablespaces(null, ProtoUtil.NULL_PROTO); ensureOk(response.getState()); return response.getTablespaceList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public List<ColumnProto> getAllColumns() { try { final BlockingInterface stub = getStub(); final GetColumnsResponse response = stub.getAllColumns(null, ProtoUtil.NULL_PROTO); ensureOk(response.getState()); return response.getColumnList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final void createFunction(final FunctionDesc funcDesc) throws DuplicateFunctionException { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.createFunction(null, funcDesc.getProto()); throwsIfThisError(state, DuplicateFunctionException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final Collection<String> getAllDatabaseNames() { try { final BlockingInterface stub = getStub(); final StringListResponse response = stub.getAllDatabaseNames(null, ProtoUtil.NULL_PROTO); ensureOk(response.getState()); return response.getValuesList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public List<TableStatsProto> getAllTableStats() { try { final BlockingInterface stub = getStub(); final GetTableStatsResponse response = stub.getAllTableStats(null, ProtoUtil.NULL_PROTO); ensureOk(response.getState()); return response.getStatsList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public void createDatabase(final String databaseName) throws DuplicateDatabaseException { try { final BlockingInterface stub = conn.getTMStub(); final ReturnState state = stub.createDatabase(null, conn.getSessionedString(databaseName)); throwsIfThisError(state, DuplicateDatabaseException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public List<TableOptionProto> getAllTableOptions() { try { final BlockingInterface stub = getStub(); final GetTablePropertiesResponse response = stub.getAllTableProperties(null, ProtoUtil.NULL_PROTO); ensureOk(response.getState()); return response.getPropertiesList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public IndexDescProto getIndex(final String indexName) { final BlockingInterface stub = conn.getTMStub(); IndexResponse res; try { res = stub.getIndexWithName(null, conn.getSessionedString(indexName)); } catch (ServiceException e) { throw new RuntimeException(e); } ensureOk(res.getState()); return res.getIndexDesc(); }
@Override public List<IndexDescProto> getAllIndexes() { try { final BlockingInterface stub = getStub(); final IndexListResponse response = stub.getAllIndexes(null, ProtoUtil.NULL_PROTO); ensureOk(response.getState()); return response.getIndexDescList(); } catch (ServiceException e) { LOG.error(e.getMessage(), e); return null; } }
@Override public IndexDescProto getIndex(final String indexName) { final BlockingInterface stub = conn.getTMStub(); IndexResponse res; try { res = stub.getIndexWithName(null, conn.getSessionedString(indexName)); } catch (ServiceException e) { throw new RuntimeException(e); } ensureOk(res.getState()); return res.getIndexDesc(); }
@Override public TablespaceProto getTablespace(final String tablespaceName) throws UndefinedTablespaceException { try { final BlockingInterface stub = getStub(); final GetTablespaceResponse response = stub.getTablespace(null, ProtoUtil.convertString(tablespaceName)); throwsIfThisError(response.getState(), UndefinedTablespaceException.class); ensureOk(response.getState()); return response.getTablespace(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public TablespaceProto getTablespace(final String tablespaceName) throws UndefinedTablespaceException { try { final BlockingInterface stub = getStub(); final GetTablespaceResponse response = stub.getTablespace(null, ProtoUtil.convertString(tablespaceName)); throwsIfThisError(response.getState(), UndefinedTablespaceException.class); ensureOk(response.getState()); return response.getTablespace(); } catch (ServiceException e) { throw new RuntimeException(e); } }