Skip to content

Commit

Permalink
Rename symbols containing proto to prism
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasHafner committed May 6, 2024
1 parent 9e1a555 commit 065016b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
26 changes: 13 additions & 13 deletions src/main/java/org/polypheny/jdbc/PolyConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public int getTimeout() {
}


public PrismInterfaceClient getProtoInterfaceClient() {
public PrismInterfaceClient getPrismInterfaceClient() {
return properties.getPrismInterfaceClient();
}

Expand All @@ -135,14 +135,14 @@ public Statement createStatement() throws SQLException {
}


public PolyStatement createProtoStatement() {
public PolyStatement createPolyStatement() {
return new PolyStatement( this );
}


@Override
public PreparedStatement prepareStatement( String sql ) throws SQLException {
PreparedStatementSignature signature = getProtoInterfaceClient().prepareIndexedStatement(
PreparedStatementSignature signature = getPrismInterfaceClient().prepareIndexedStatement(
properties.getNamespaceName(),
PropertyUtils.getSQL_LANGUAGE_NAME(),
sql,
Expand Down Expand Up @@ -188,7 +188,7 @@ public boolean getAutoCommit() throws SQLException {
public void commit() throws SQLException {
throwIfClosed();
throwIfAutoCommit();
getProtoInterfaceClient().commitTransaction( getNetworkTimeout() );
getPrismInterfaceClient().commitTransaction( getNetworkTimeout() );
hasRunningTransaction = false;
}

Expand All @@ -197,7 +197,7 @@ public void commit() throws SQLException {
public void rollback() throws SQLException {
throwIfClosed();
throwIfAutoCommit();
getProtoInterfaceClient().rollbackTransaction( getNetworkTimeout() );
getPrismInterfaceClient().rollbackTransaction( getNetworkTimeout() );
}


Expand All @@ -209,7 +209,7 @@ public void close() throws SQLException {
for ( Statement openStatement : new HashSet<>( openStatements ) ) {
openStatement.close();
}
getProtoInterfaceClient().unregister( properties.getNetworkTimeout() );
getPrismInterfaceClient().unregister( properties.getNetworkTimeout() );
isClosed = true;
}

Expand Down Expand Up @@ -299,7 +299,7 @@ public PreparedStatement prepareStatement( String sql, int resultSetType, int re
throwIfClosed();
PropertyUtils.throwIfInvalid( resultSetType, resultSetConcurrency );
PolyphenyStatementProperties statementProperties = properties.toStatementProperties( resultSetType, resultSetConcurrency );
PreparedStatementSignature signature = getProtoInterfaceClient().prepareIndexedStatement(
PreparedStatementSignature signature = getPrismInterfaceClient().prepareIndexedStatement(
properties.getNamespaceName(),
PropertyUtils.getSQL_LANGUAGE_NAME(),
sql,
Expand Down Expand Up @@ -383,7 +383,7 @@ public PreparedStatement prepareStatement( String sql, int resultSetType, int re
throwIfClosed();
PropertyUtils.throwIfInvalid( resultSetType, resultSetConcurrency, resultSetHoldability );
PolyphenyStatementProperties statementProperties = properties.toStatementProperties( resultSetType, resultSetConcurrency, resultSetHoldability );
PreparedStatementSignature signature = getProtoInterfaceClient().prepareIndexedStatement(
PreparedStatementSignature signature = getPrismInterfaceClient().prepareIndexedStatement(
properties.getNamespaceName(),
PropertyUtils.getSQL_LANGUAGE_NAME(),
sql,
Expand Down Expand Up @@ -457,8 +457,8 @@ public boolean isValid( int timeout ) throws SQLException {
if ( timeout < 0 ) {
throw new PrismInterfaceServiceException( PrismInterfaceErrors.VALUE_ILLEGAL, "Illegal argument for timeout" );
}
// the proto-interface uses milliseconds for timeouts, jdbc uses seconds
return getProtoInterfaceClient().checkConnection( timeout * 1000 );
// the prism-interface uses milliseconds for timeouts, jdbc uses seconds
return getPrismInterfaceClient().checkConnection( timeout * 1000 );
}


Expand All @@ -467,7 +467,7 @@ public void setClientInfo( String name, String value ) throws SQLClientInfoExcep
Properties clientInfoProperties = getClientInfo();
clientInfoProperties.setProperty( name, value );
try {
getProtoInterfaceClient().setClientInfoProperties( clientInfoProperties, properties.getNetworkTimeout() );
getPrismInterfaceClient().setClientInfoProperties( clientInfoProperties, properties.getNetworkTimeout() );
} catch ( PrismInterfaceServiceException e ) {
throw new SQLClientInfoException( e.getMessage(), e.getSQLState(), e.getErrorCode(), new HashMap<>(), e );
}
Expand All @@ -477,7 +477,7 @@ public void setClientInfo( String name, String value ) throws SQLClientInfoExcep
@Override
public void setClientInfo( Properties clientInfoProperties ) throws SQLClientInfoException {
try {
getProtoInterfaceClient().setClientInfoProperties( clientInfoProperties, properties.getNetworkTimeout() );
getPrismInterfaceClient().setClientInfoProperties( clientInfoProperties, properties.getNetworkTimeout() );
} catch ( PrismInterfaceServiceException e ) {
HashMap<String, ClientInfoStatus> failedOptions = new HashMap<>();
throw new SQLClientInfoException( e.getMessage(), e.getSQLState(), e.getErrorCode(), new HashMap<>(), e );
Expand All @@ -495,7 +495,7 @@ public String getClientInfo( String name ) throws SQLException {
public Properties getClientInfo() throws SQLClientInfoException {
try {
Properties properties = new Properties();
properties.putAll( getProtoInterfaceClient().getClientInfoProperties( getNetworkTimeout() ) );
properties.putAll( getPrismInterfaceClient().getClientInfoProperties( getNetworkTimeout() ) );
return properties;
} catch ( SQLException e ) {
throw new SQLClientInfoException();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/polypheny/jdbc/PolyphenyStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean hasStatementId() {


protected PrismInterfaceClient getClient() {
return polyConnection.getProtoInterfaceClient();
return polyConnection.getPrismInterfaceClient();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private void addDocuments( DocumentFrame documentFrame ) {
private void fetchMore() throws PrismInterfaceServiceException {
int id = polyStatement.getStatementId();
int timeout = getPolyphenyConnection().getTimeout();
Frame frame = getProtoInterfaceClient().fetchResult( id, timeout, PropertyUtils.getDEFAULT_FETCH_SIZE() );
Frame frame = getPrismInterfaceClient().fetchResult( id, timeout, PropertyUtils.getDEFAULT_FETCH_SIZE() );
if ( frame.getResultCase() != ResultCase.DOCUMENT_FRAME ) {
throw new PrismInterfaceServiceException(
PrismInterfaceErrors.RESULT_TYPE_INVALID,
Expand All @@ -71,8 +71,8 @@ private PolyConnection getPolyphenyConnection() {
}


private PrismInterfaceClient getProtoInterfaceClient() {
return getPolyphenyConnection().getProtoInterfaceClient();
private PrismInterfaceClient getPrismInterfaceClient() {
return getPolyphenyConnection().getPrismInterfaceClient();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ private void resetStatement() {
}


private PrismInterfaceClient getProtoInterfaceClient() {
return connection.getProtoInterfaceClient();
private PrismInterfaceClient getPrismInterfaceClient() {
return connection.getPrismInterfaceClient();
}


Expand All @@ -67,7 +67,7 @@ public Result execute( String namespaceName, String languageName, String stateme
resetStatement();
CallbackQueue<StatementResponse> callback = new CallbackQueue<>( Response::getStatementResponse );
int timeout = connection.getTimeout();
getProtoInterfaceClient().executeUnparameterizedStatement(
getPrismInterfaceClient().executeUnparameterizedStatement(
namespaceName,
languageName,
statement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private void addRows( RelationalFrame relationalFrame ) {
private void fetchMore() throws PrismInterfaceServiceException {
int id = polyStatement.getStatementId();
int timeout = getPolyphenyConnection().getTimeout();
Frame frame = getProtoInterfaceClient().fetchResult( id, timeout, PropertyUtils.getDEFAULT_FETCH_SIZE() );
Frame frame = getPrismInterfaceClient().fetchResult( id, timeout, PropertyUtils.getDEFAULT_FETCH_SIZE() );
if ( frame.getResultCase() != ResultCase.DOCUMENT_FRAME ) {
throw new PrismInterfaceServiceException(
PrismInterfaceErrors.RESULT_TYPE_INVALID,
Expand All @@ -70,8 +70,8 @@ private PolyConnection getPolyphenyConnection() {
}


private PrismInterfaceClient getProtoInterfaceClient() {
return getPolyphenyConnection().getProtoInterfaceClient();
private PrismInterfaceClient getPrismInterfaceClient() {
return getPolyphenyConnection().getPrismInterfaceClient();
}


Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/polypheny/jdbc/QueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void simpleRelationalTest() throws ClassNotFoundException {
if ( !connection.isWrapperFor( PolyConnection.class ) ) {
fail( "Driver must support unwrapping to PolyphenyConnection" );
}
PolyStatement polyStatement = connection.unwrap( PolyConnection.class ).createProtoStatement();
PolyStatement polyStatement = connection.unwrap( PolyConnection.class ).createPolyStatement();
Result result = polyStatement.execute( "public", "sql", "SELECT* FROM emps" );
assertEquals( ResultType.RELATIONAL, result.getResultType() );
} catch ( SQLException e ) {
Expand All @@ -84,7 +84,7 @@ public void simpleMqlTest() throws ClassNotFoundException {
if ( !connection.isWrapperFor( PolyConnection.class ) ) {
fail( "Driver must support unwrapping to PolyphenyConnection" );
}
PolyStatement polyStatement = connection.unwrap( PolyConnection.class ).createProtoStatement();
PolyStatement polyStatement = connection.unwrap( PolyConnection.class ).createPolyStatement();
Result result = polyStatement.execute( "public", MQL_LANGUAGE_NAME, TEST_QUERY );
assertEquals( ResultType.DOCUMENT, result.getResultType() );
} catch ( SQLException e ) {
Expand All @@ -99,7 +99,7 @@ public void mqlDataRetrievalTest() throws ClassNotFoundException {
if ( !connection.isWrapperFor( PolyConnection.class ) ) {
fail( "Driver must support unwrapping to PolyphenyConnection" );
}
PolyStatement polyStatement = connection.unwrap( PolyConnection.class ).createProtoStatement();
PolyStatement polyStatement = connection.unwrap( PolyConnection.class ).createPolyStatement();
Result result = polyStatement.execute( "public", MQL_LANGUAGE_NAME, TEST_QUERY );
DocumentResult docs = result.unwrap( DocumentResult.class );
for ( PolyDocument doc : docs ) {
Expand Down

0 comments on commit 065016b

Please sign in to comment.