Package com.microsoft.azure.kusto.data
Class ClientImpl
- java.lang.Object
-
- com.microsoft.azure.kusto.data.ClientImpl
-
- All Implemented Interfaces:
Client,StreamingClient
public class ClientImpl extends Object implements Client, StreamingClient
-
-
Field Summary
Fields Modifier and Type Field Description static StringFEDERATED_SECURITY_SUFFIXstatic StringJAVA_INGEST_ACTIVITY_TYPE_PREFIXstatic StringMGMT_ENDPOINT_VERSIONstatic StringQUERY_ENDPOINT_VERSIONstatic StringSTREAMING_VERSION
-
Constructor Summary
Constructors Constructor Description ClientImpl(ConnectionStringBuilder csb)ClientImpl(ConnectionStringBuilder csb, HttpClientProperties properties)ClientImpl(ConnectionStringBuilder csb, org.apache.http.impl.client.CloseableHttpClient httpClient)
-
Method Summary
-
-
-
Field Detail
-
MGMT_ENDPOINT_VERSION
public static final String MGMT_ENDPOINT_VERSION
- See Also:
- Constant Field Values
-
QUERY_ENDPOINT_VERSION
public static final String QUERY_ENDPOINT_VERSION
- See Also:
- Constant Field Values
-
STREAMING_VERSION
public static final String STREAMING_VERSION
- See Also:
- Constant Field Values
-
FEDERATED_SECURITY_SUFFIX
public static final String FEDERATED_SECURITY_SUFFIX
- See Also:
- Constant Field Values
-
JAVA_INGEST_ACTIVITY_TYPE_PREFIX
public static final String JAVA_INGEST_ACTIVITY_TYPE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClientImpl
public ClientImpl(ConnectionStringBuilder csb) throws URISyntaxException
- Throws:
URISyntaxException
-
ClientImpl
public ClientImpl(ConnectionStringBuilder csb, HttpClientProperties properties) throws URISyntaxException
- Throws:
URISyntaxException
-
ClientImpl
public ClientImpl(ConnectionStringBuilder csb, org.apache.http.impl.client.CloseableHttpClient httpClient) throws URISyntaxException
- Throws:
URISyntaxException
-
-
Method Detail
-
execute
public KustoOperationResult execute(String command) throws DataServiceException, DataClientException
Description copied from interface:StreamingClientExecute the provided command against the default database.
- Specified by:
executein interfaceClient- Specified by:
executein interfaceStreamingClient- Parameters:
command- The command to execute- Returns:
KustoOperationResultobject including the ingestion result- Throws:
DataServiceException- An exception returned from the serviceDataClientException- An exception originating from a client activity
-
execute
public KustoOperationResult execute(String database, String command) throws DataServiceException, DataClientException
- Specified by:
executein interfaceClient- Throws:
DataServiceExceptionDataClientException
-
execute
public KustoOperationResult execute(String database, String command, ClientRequestProperties properties) throws DataServiceException, DataClientException
- Specified by:
executein interfaceClient- Throws:
DataServiceExceptionDataClientException
-
executeToJsonResult
public String executeToJsonResult(String command) throws DataServiceException, DataClientException
- Specified by:
executeToJsonResultin interfaceClient- Throws:
DataServiceExceptionDataClientException
-
executeToJsonResult
public String executeToJsonResult(String database, String command) throws DataServiceException, DataClientException
- Specified by:
executeToJsonResultin interfaceClient- Throws:
DataServiceExceptionDataClientException
-
executeToJsonResult
public String executeToJsonResult(String database, String command, ClientRequestProperties properties) throws DataServiceException, DataClientException
- Specified by:
executeToJsonResultin interfaceClient- Throws:
DataServiceExceptionDataClientException
-
executeStreamingIngest
public KustoOperationResult executeStreamingIngest(String database, String table, InputStream stream, ClientRequestProperties properties, String streamFormat, String mappingName, boolean leaveOpen) throws DataServiceException, DataClientException
Description copied from interface:StreamingClientIngest data from a given stream directly into Kusto database.
This method ingests the data from a given stream directly into Kusto database, using streaming ingestion endpoint, with additional properties mentioned iningestionPropertiesIt is not recommended to use this method directly, but the StreamingIngestClient from the Ingest package.- Specified by:
executeStreamingIngestin interfaceStreamingClient- Parameters:
database- The target database to ingest totable- The target table to ingest tostream- An InputStream which holds the dataproperties- Additional request headers of the ingestion requeststreamFormat- The format of the data in the provided streammappingName- Pre-defined mapping reference. Required for Json and Avro formatsleaveOpen- Specifies if the given stream should be closed after reading or be left open- Returns:
KustoOperationResultobject including the ingestion result- Throws:
DataServiceException- An exception returned from the serviceDataClientException- An exception originating from a client activity
-
executeStreamingQuery
public InputStream executeStreamingQuery(String command) throws DataServiceException, DataClientException
- Specified by:
executeStreamingQueryin interfaceStreamingClient- Throws:
DataServiceExceptionDataClientException
-
executeStreamingQuery
public InputStream executeStreamingQuery(String database, String command) throws DataServiceException, DataClientException
- Specified by:
executeStreamingQueryin interfaceStreamingClient- Throws:
DataServiceExceptionDataClientException
-
executeStreamingQuery
public InputStream executeStreamingQuery(String database, String command, ClientRequestProperties properties) throws DataServiceException, DataClientException
Description copied from interface:StreamingClientQuery directly from Kusto database using streaming output.
This method queries the Kusto database into a stream, using streaming query endpoint, with additional properties mentioned iningestionProperties- Specified by:
executeStreamingQueryin interfaceStreamingClient- Parameters:
database- The target database to querycommand- The command (query or admin command) to executeproperties- Additional request headers of the ingestion request- Returns:
- InputStream Streaming json result, which must be closed by the caller
- Throws:
DataServiceException- An exception returned from the serviceDataClientException- An exception originating from a client activity
-
getClusterUrl
public String getClusterUrl()
-
-