@Override public final boolean existDatabase(final String databaseName) { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.existDatabase(null, ProtoUtil.convertString(databaseName)); if (isThisError(state, UNDEFINED_DATABASE)) { return false; } ensureOk(state); return true; } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final boolean existDatabase(final String databaseName) { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.existDatabase(null, ProtoUtil.convertString(databaseName)); if (isThisError(state, UNDEFINED_DATABASE)) { return false; } ensureOk(state); return true; } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final boolean existTablespace(final String tablespaceName) { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.existTablespace(null, ProtoUtil.convertString(tablespaceName)); if (isThisError(state, UNDEFINED_TABLESPACE)) { return false; } ensureOk(state); return true; } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final boolean existTablespace(final String tablespaceName) { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.existTablespace(null, ProtoUtil.convertString(tablespaceName)); if (isThisError(state, UNDEFINED_TABLESPACE)) { return false; } ensureOk(state); return true; } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final void dropTablespace(final String tablespaceName) throws UndefinedTablespaceException, InsufficientPrivilegeException { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.dropTablespace(null, ProtoUtil.convertString(tablespaceName)); throwsIfThisError(state, UndefinedTablespaceException.class); throwsIfThisError(state, InsufficientPrivilegeException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final Collection<String> getAllTableNames(final String databaseName) { try { final BlockingInterface stub = getStub(); final StringListResponse response = stub.getAllTableNames(null, ProtoUtil.convertString(databaseName)); ensureOk(response.getState()); return response.getValuesList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final Collection<String> getAllTableNames(final String databaseName) { try { final BlockingInterface stub = getStub(); final StringListResponse response = stub.getAllTableNames(null, ProtoUtil.convertString(databaseName)); ensureOk(response.getState()); return response.getValuesList(); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final void dropTablespace(final String tablespaceName) throws UndefinedTablespaceException, InsufficientPrivilegeException { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.dropTablespace(null, ProtoUtil.convertString(tablespaceName)); throwsIfThisError(state, UndefinedTablespaceException.class); throwsIfThisError(state, InsufficientPrivilegeException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final void dropDatabase(final String databaseName) throws UndefinedDatabaseException, InsufficientPrivilegeException { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.dropDatabase(null, ProtoUtil.convertString(databaseName)); throwsIfThisError(state, UndefinedDatabaseException.class); throwsIfThisError(state, InsufficientPrivilegeException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }
@Override public final void dropDatabase(final String databaseName) throws UndefinedDatabaseException, InsufficientPrivilegeException { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.dropDatabase(null, ProtoUtil.convertString(databaseName)); throwsIfThisError(state, UndefinedDatabaseException.class); throwsIfThisError(state, InsufficientPrivilegeException.class); ensureOk(state); } 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); } }
@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); } }
public static void fillRow(int i, RowWriter builder) { builder.startRow(); builder.putBool(i % 1 == 0 ? true : false); // 0 builder.putInt2((short) 1); // 1 builder.putInt4(i); // 2 builder.putInt8(i); // 3 builder.putFloat4(i); // 4 builder.putFloat8(i); // 5 builder.putText((UNICODE_FIELD_PREFIX + i).getBytes()); // 6 builder.putTimestamp(DatumFactory.createTimestamp("2014-04-16 08:48:00").asInt8() + i); // 7 builder.putDate(DatumFactory.createDate("2014-04-16").asInt4() + i); // 8 builder.putTime(DatumFactory.createTime("08:48:00").asInt8() + i); // 9 builder.putInterval(DatumFactory.createInterval((i + 1) + " hours")); // 10 builder.putProtoDatum(new ProtobufDatum(ProtoUtil.convertString(i + ""))); // 11 builder.endRow(); }
public static void validateTupleResult(int j, Tuple t) { assertTrue((j % 1 == 0) == t.getBool(0)); assertTrue(1 == t.getInt2(1)); assertEquals(j, t.getInt4(2)); assertEquals(j, t.getInt8(3)); assertTrue(j == t.getFloat4(4)); assertTrue(j == t.getFloat8(5)); assertEquals(new String(UNICODE_FIELD_PREFIX + j), t.getText(6)); assertEquals(DatumFactory.createTimestamp("2014-04-16 08:48:00").asInt8() + (long) j, t.getInt8(7)); assertEquals(DatumFactory.createDate("2014-04-16").asInt4() + j, t.getInt4(8)); assertEquals(DatumFactory.createTime("08:48:00").asInt8() + j, t.getInt8(9)); assertEquals(DatumFactory.createInterval((j + 1) + " hours"), t.getInterval(10)); assertEquals(new ProtobufDatum(ProtoUtil.convertString(j + "")), t.getProtobufDatum(11)); }
writer.skipField(); } else { writer.putProtoDatum(new ProtobufDatum(ProtoUtil.convertString(i + ""))); // 12
tuple.isBlankOrNull(12); } else { assertEquals(new ProtobufDatum(ProtoUtil.convertString(j + "")), tuple.getProtobufDatum(12));