Delen via


LabeledResultSet Class

  • java.lang.Object
    • AutoCloseable
      • com.microsoft.azure.elasticdb.query.multishard.LabeledResultSet

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 MultiShardException getException()
final ResultSet getResultSet()
final String getShardLabel()
final ShardLocation 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:

exception
shardLocation - The Shard this reader belongs to
statement - The statement object that produced the reader.

Throws:

IllegalArgumentException - If either of the arguments is null.

LabeledResultSet

public LabeledResultSet(ResultSet resultSet, ShardLocation shardLocation, Statement statement)

Simple constructor to set up an immutable LabeledResultSet object.

Parameters:

resultSet
shardLocation - The Shard this reader belongs to
statement - The statement object that produced the reader.

Throws:

IllegalArgumentException - If either of the arguments is null.

LabeledResultSet

public LabeledResultSet(ShardLocation shardLocation, Statement statement)

Simple constructor to set up an immutable LabeledResultSet object.

Parameters:

shardLocation - The Shard this reader belongs to
statement - The statement object that produced the reader.

Throws:

IllegalArgumentException - If either of the arguments is null.

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:

value

Applies to