LabeledResultSet Class
- java.
lang. Object - AutoCloseable
- com.
microsoft. azure. elasticdb. query. multishard. LabeledResultSet
- com.
public class LabeledResultSet
Simple, immutable class for affiliating a ResultSet with additional information related to the reader (e.g. Statement, shard, exceptions encountered etc) Useful when grabbing ResultSets asynchronously. Purpose: Convenience class that holds a ResultSet along with a string label for the shard that the data underlying the ResultSet came from. Notes: This is useful for keeping the ResultSet and the label together when executing asynchronously.
Constructor Summary
Constructor | Description |
---|---|
LabeledResultSet(MultiShardException exception, ShardLocation shardLocation, Statement statement) |
Simple constructor to set up an immutable LabeledResultSet object. |
LabeledResultSet(ResultSet resultSet, ShardLocation shardLocation, Statement statement) |
Simple constructor to set up an immutable LabeledResultSet object. |
LabeledResultSet(ShardLocation shardLocation, Statement statement) |
Simple constructor to set up an immutable LabeledResultSet object. |
Method Summary
Modifier and Type | Method and Description |
---|---|
final void |
close()
AutoClosable Implementation. |
final Connection |
getConnection()
The Connection associated with this reader. |
final Multi |
getException() |
final ResultSet | getResultSet() |
final String | getShardLabel() |
final Shard |
getShardLocation() |
final Statement | getStatement() |
final void | setShardLabel(String value) |
Constructor Details
LabeledResultSet
public LabeledResultSet(MultiShardException exception, ShardLocation shardLocation, Statement statement)
Simple constructor to set up an immutable LabeledResultSet object.
Parameters:
Throws:
LabeledResultSet
public LabeledResultSet(ResultSet resultSet, ShardLocation shardLocation, Statement statement)
Simple constructor to set up an immutable LabeledResultSet object.
Parameters:
Throws:
LabeledResultSet
public LabeledResultSet(ShardLocation shardLocation, Statement statement)
Simple constructor to set up an immutable LabeledResultSet object.
Parameters:
Throws:
Method Details
close
public final void close()
AutoClosable Implementation.
getConnection
public final Connection getConnection()
The Connection associated with this reader.
getException
public final MultiShardException getException()
getResultSet
public final ResultSet getResultSet()
getShardLabel
public final String getShardLabel()
getShardLocation
public final ShardLocation getShardLocation()
getStatement
public final Statement getStatement()
setShardLabel
public final void setShardLabel(String value)
Parameters: