Граф коммитов

338 Коммитов

Автор SHA1 Сообщение Дата
AsafMah d16a2715ee
Add metadata endpoint (#177)
* Kusto now queries the provided cluster for metadata. This fixes incompatibility issues with other clouds, or services like Synapse. The results are cached and don't require any changes to the user's code or behavior.
2021-06-30 10:41:31 +03:00
KustoIbizaExtension Build f70cf8b8c0 2.7.1 2021-06-29 15:49:20 +03:00
ohad bitton a110f859f2
githubrepo usr (#173) 2021-06-29 15:30:16 +03:00
ohad bitton b2155aa5e8
Primitive object getters to support Null values (#176)
* new API to get primitive as objects to handle null values

* nulls

* better

* comments

* comments

Co-authored-by: KustoIbizaExtension Build <kustodev@microsoft.com>
2021-06-29 13:47:00 +03:00
AsafMah 1f1d1245b4
Fixed old readme code (#178) 2021-06-27 14:02:48 +03:00
ohad bitton 03aabae864
Exceptions handling (#174)
* exception handling

* nicer errors

* permanency

* is permanent exceptions

* isPermanent as triState

* enum triState

* enum triState

* better errors

* nit

* naming - KustoServiceQueryError

Co-authored-by: KustoIbizaExtension Build <kustodev@microsoft.com>
2021-05-25 15:54:20 +03:00
Yihezkel Schoenbrun 2bb0d1b8b8
Upgrade version from 2.6.0 to 2.7.0 (#172) 2021-04-11 21:30:29 +03:00
Yihezkel Schoenbrun ad652df53a
Add streaming query API (#170)
* Add streaming query API

* - Add some resource closing enhancements
- Wrap the CloseParentResourcesStream in a EofSensorInputStream, as opposed to the converse

* Add TODO to reuse HttpClient

* Use existing Java exception formatting, which is an improvement over the .NET exception
2021-04-11 18:46:34 +03:00
ohad bitton 133b5e254f
Device authentication (#169)
* device authentication

* revert device E2E

* comments

* make base class protected

* make base class protected
2021-03-22 18:31:14 +02:00
Yihezkel Schoenbrun 97ae1807cb
Upgrade version to 2.5.1 (#168) 2021-03-11 12:08:33 +02:00
Yihezkel Schoenbrun 9a5976860c
Add new API to query returning a json result (#166)
* Add new API to query so that the result is a json. When the caller doesn't need the Java object, this saves time converting to a Java object in the SDK and from the caller converting from the Java object.

* - Split input variables validation
- trim() command

* Rename from executeForJsonResult to executeToJsonResult

* Rename from executeForJsonResult to executeToJsonResult

* Streaming endpoint is always v1
2021-03-09 12:39:38 +02:00
Yihezkel Schoenbrun ce1a716062
Optimize and upgrade dependency versions (#167)
* - Optimize and upgrade dependency versions
- Remove dependency duplicates/conflicts
- Resolve mvn warnings

* - Use range to ensure specific minor version of jackson dependencies
- Upgrade flatten-maven-plugin
2021-03-08 17:31:42 +02:00
Yihezkel Schoenbrun 6ae22dcb6f
Optimize ResourceManager and minor improvements in a few other classes (#163)
* Optimize ResourceManager and minor improvements in a few other classes

* Change naming from storageRoot to storageUrl
2021-03-03 19:23:55 +02:00
Yihezkel Schoenbrun f6c5b36cc3
Upgrade version from 2.4.2 to to 2.5.0 (#164) 2021-02-14 10:56:46 +02:00
maltalex 1986a5789f
added classes for generating pojos from KustoResultSetTable instances (#159)
* added classes for generating pojos from KustoResultSetTable instances

This commit includes three new classes:
1. KustoType which is a generic class for representing different Kusto
column types and bind them to different Java types

2. KustoColumn which represents a Kusto column - it has a name,
nullability information, and a type (KustoType)

3. KustoResultMapper which can be set up to parse KustoResultSetTable
instances and return a list of pojos. The setup phase is done using a
builder that takes the pojo constructor, as well as zero or more
instances of KustoColumn along with setter functions to set pojo's
fields based on the column values.

This mechanism can potentially be extended to use reflection based on
the target pojo class instead of the manual KustoResultMapper setup

* Update data/src/main/java/com/microsoft/azure/kusto/data/KustoType.java

Changed documentation link to international version

Co-authored-by: ohad bitton <32278684+ohadbitt@users.noreply.github.com>

* Use String.format() for exception messages

* Introduced ObjectPopulator class, ordinal column mapping

- Unified KustoColumn and QueryResultColumnInfo into the new
ObjectPopulator class
- Added support for manually specified column ordinals
- extractList finds column indexes once per result set to save on column
lookups

* KustoResultMapper extractSingle - don't create empty objects

If the KustoResultSetTable is null, the proper response is to return a
null object, not an unpopulated one

* ObjectPopulator - always use column index, formatting

populateFrom used to get objects from the ResultSet by the column name
unless an ordinal was set. Now it always uses the ordinal (looking it up
if necessary).

* KustoType formatting - don't align field declarations

* KustoResultMapperTest

The test uses a mocked KustoResultMapper to test the pojo mapping
functionality of the KustoResultMapper

* Update KustoType.java

* Removed addNonNullableColumn/addNonNullableColumn, added javadoc

Instead of individual addNonNullableColumn/addNullableColumn methods,
exposed the more generic addColumn methods. Additionally, added javadoc
to document the addColumn parameters

* Renamed ObjectPopulator to KustoResultColumnPopulator

* KustoResultColumnPopulator::populateFrom use passed ordinal

populateFrom used to always lookup the column ordinal by name instead of
using the passed ordinal. Now it's always using the ordinal, moving the
responsibility of correctly determining that ordinal to the caller.

* renamed variable in KustoResultColumnPopulator::populateFrom

* KustoResultMapper::extractList renamed variable

* added "single" to names of tests of KustoResultMapper::extractSingle

* Javadoc fixes in KustoType and KustoResultMapper

Co-authored-by: ohad bitton <32278684+ohadbitt@users.noreply.github.com>
2021-02-05 02:15:04 +02:00
Yihezkel Schoenbrun f4da15d312
Rearchitect the AAD authentication code to be object oriented (#160)
* Rearchitect the AAD authentication code to be object oriented and follow best-practices (Java and otherwise)

* Rearchitect the AAD authentication code to be object oriented and follow best-practices (Java and otherwise)

* Code review comments:
- Rename to CallbackTokenProvider
- Remove 2 unnecessarily-passed authorityIds

* Add another layer of abstraction (MsalTokenProvider)

* Add another layer of abstraction (MsalTokenProvider)

* Add Override annotation per code review comment
2021-01-07 13:15:08 +02:00
Yihezkel Schoenbrun 2e05191f2a
Replace ADAL authentication library with MSAL (#155)
* Convert from ADAL to MSAL (include a few questions to be resolved during code review)

* Resolve some TODOs

* Some minor changes and some changes from code review

* Incorporate most review comments

* Add '/' to authority to resolve issue.

* Per Yochai's request, first try to access the token silently, and if that fails authenticate from scratch

* Make the method determineAadAuthorityUrl() less confusing

* Fix error

* Fix test
2020-12-20 19:42:18 +02:00
Ohad Bitton 8e6e6ffe95 v2.4.2 2020-12-13 13:39:06 +02:00
ohad bitton c5079020c9
Remove federated url path if set (#152)
* remove federated url path if set

* ignore case

* better

* test

* fix test

* raw format

* comments

* comments

Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
2020-12-13 13:36:41 +02:00
ohad bitton 3e30e743e1
Better exception message in post request (#156)
* better exception message in post request

* v2.4.1

Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
2020-11-19 14:04:26 +02:00
Ohad Bitton f48266e41d v2.4.0 2020-11-18 15:37:50 +02:00
Ohad Bitton 99b6a6d2ea Add error.message to the Message of execute 2020-11-18 15:36:27 +02:00
ohbitton fc3b8a0c63 Merge remote-tracking branch 'origin/master' 2020-10-26 17:16:32 +02:00
ohbitton d07ae36e95 revert creds 2020-10-26 17:15:05 +02:00
Yihezkel Schoenbrun a75db70f3a
Streaming client wrong endpoint detection (#149)
* Streaming client wrong endpoint detection

* Fix invalid character for the file's encoding

* Add parent class to both Queued and Streaming IngestClients for the local purpose of removing significant code duplication in the wrong-endpoint-detection feature.
This change represents a better architecture that will yield further benefits.

* Rename AbstractIngestClient to IngestClientBase
2020-10-13 21:02:22 +03:00
AsafMah 9dce220692
ManagedStreamingIngestClient (#151)
Adds ManagedStreamingIngestClient to support multiple streaming retries and queue fallback.



commits:
* First commit, create file and basic members

* basic copy-paste argument validation, close streams on close.
no logic yet

* Copy ctors for all the needed types

* Filled out other methods (Like in the c# manager, all of them redirect to stream, except blob which goes directly to the queued ingestor)

* Simplest support for actual streaming

* Fixed with new name for the queued client

* Removed unsued stuff for now, added doc comment.

* Some small fixes from testing -
 - Log exception
 - Add a direct c-tor
 - Catch all exception types, since they may be unpredictable

* Reset the stream after an exception

* Adding tests for the class

* cleanup imports

* Added annotations as an explicit dependency(like in data) to appease CI.

* Update ingest/src/main/java/com/microsoft/azure/kusto/ingest/ManagedStreamingIngestClient.java

grammar

Co-authored-by: boazsha <15858748+boazsha@users.noreply.github.com>

* Update ingest/src/main/java/com/microsoft/azure/kusto/ingest/ManagedStreamingIngestClient.java

grammar

Co-authored-by: boazsha <15858748+boazsha@users.noreply.github.com>

* Change retry count to 3

* Made the json file tests different from each other, plus they now check the stream.

The gz file was changed since the old one had CRLF line endings, while the uncompressed one had LF.

* Documentation - added a note to explain ingestFromBlob's behaviour, and some tiny grammar fixes.

* Removed default compile annotation

* Update ingest/src/main/java/com/microsoft/azure/kusto/ingest/ManagedStreamingIngestClient.java

Co-authored-by: Boaz Shalom <15858748+boazsha@users.noreply.github.com>

* Removed todo comments from tests, since we decided to keep them this way

* Pass the to the StreamSourceInfo ctor whenever applicable

* Make comments fit the style

* Added doc for ingestFromBlob function

* Added factory for managed streaming ingest client

* Fixed managedingest from files - since FileInputStream isn't resettable, we can't use managed with it, so I added a class for it and a test.

* Reset the mock properly

* Add license

* Parsing permanent exceptions from the api (marked as @permanent=true in the returning json) and stopping if it is one.

* Reset the client in all tests

* Made compressedJson test work despite the fact that the stream closes in the end

* Adding debug prints to the comparison test since I don't know how else to check tests that run on my machine but fail on the testing machine

* Try using alternative method of reading string to avoid newline issue

* Also fixed the other one to make the tests pass, but we'll still have to look into why the file changes on the test machine

* Add UncloseableStream class

* Fixed typo

* Solve the newlines problem by hardcoding the string result into the test file.

* Use UncloseableStream in utils (still needs tests)

* Update ingest/src/main/java/com/microsoft/azure/kusto/ingest/ManagedStreamingIngestClient.java

Co-authored-by: ohad bitton <32278684+ohadbitt@users.noreply.github.com>

* Use proper reset function in tests

* Unit test UncloseableStream

* Correct format for web error

Co-authored-by: boazsha <15858748+boazsha@users.noreply.github.com>
Co-authored-by: ohad bitton <32278684+ohadbitt@users.noreply.github.com>
2020-10-13 13:15:30 +03:00
ohad bitton a1417109a2
Expose authority id for all authenticaiton methods (#153)
* Expose authority ID in all authentication methods

* version 2.3.2

* version 2.3.2
2020-09-30 17:56:36 +03:00
Ohad Bitton 2fdff9e618 version 2.3.1 2020-09-08 13:12:05 +03:00
Ohad Bitton b21fc31938 support clientRequestId 2020-09-08 12:55:05 +03:00
ohad bitton 59aa42e2c5
Accept json response + fix maven build warnings (#150)
* accept application/json + use same jackson version as spark connector

* version 2.3.0

* restrain nimbus version (resolve nimbus class not found)

* Fix maven warnings

* Fix maven warnings

* Update data/pom.xml

Co-authored-by: vladikbr <31644896+vladikbr@users.noreply.github.com>

* clean

Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
Co-authored-by: vladikbr <31644896+vladikbr@users.noreply.github.com>
2020-09-07 10:00:03 +03:00
Yihezkel Schoenbrun b1d3900dde
Add detection of wrong endpoint with correct endpoint URI suggestion (#143)
* Add detection of wrong endpoint with correct endpoint URI suggestion

* Fix code review comments

* Remove extraneous comment from test

* Queued Ingestion's wrong endpoint detection is more generic to reduce code duplication if the same feature is added for Streaming Ingestion.

Co-authored-by: ohad bitton <32278684+ohadbitt@users.noreply.github.com>
2020-09-02 08:44:45 +03:00
Ohad Bitton 4a64402e70 v2.2.0 2020-08-27 16:13:56 +03:00
ohad bitton 0e1112a98e
Support authentication via callable (#148)
* support authentication via callable

* naming

Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
2020-08-27 15:53:48 +03:00
ohad bitton 8353f73225
Update pom.xml 2020-08-17 12:56:52 +03:00
ohad bitton 5e5ae1402d
Server timeout fix (#147)
* server timeout in timespan

* server timeout in timespan

* client timeout

Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
2020-08-10 20:13:19 +03:00
ohad bitton 16cc0e8102
Greater adal version (#144)
* reduced wait time on Err

* err

Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
2020-08-02 16:02:48 +03:00
ohad bitton cbe98d307e
Better timings for refresh test 2020-07-14 19:13:32 +03:00
ohad bitton 0d2031de19
Update pom.xml 2020-06-23 20:05:29 +03:00
ohad bitton 1c8b260d48
table id can be guid (#142)
Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
2020-06-23 20:04:18 +03:00
ohad bitton 0b25d2dc9b
Reduced refresh time interval on Err (#140)
* reduced wait time on Err

* reduced wait time on Err

* test reduced wait time on Err

* reduced wait time on Err

Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
2020-06-23 20:02:52 +03:00
vladikbr 35d682a89b
Add copyright headers, per MS OSS guidelines. (#141) 2020-06-22 14:38:59 +03:00
ohad bitton 457d21bb79
Bump version 2.1.0 (#139)
* Update pom.xml

* Update README.md
2020-06-14 11:56:18 +03:00
ohad bitton 21899206b5
Exceptions can be null (#137)
* Update KustoResultSetTable.java

* Update AadAuthenticationHelper.java
2020-06-14 11:46:34 +03:00
Michael Spector ad9cebb6d6
Add missing ApacheAvro format (#138)
Co-authored-by: Michael Spector <spektom@gmail.com>
2020-06-14 09:34:09 +03:00
Yochai Gilad 70cd5edfec
Add a Pull Request template to the repository (#133) 2020-05-19 08:46:58 +03:00
ohad bitton e47d48b2d3
v2.0.2 (#132)
* Update pom.xml

* Update README.md
2020-05-05 15:13:39 +03:00
ohad bitton f339e21733
getter (#131)
Co-authored-by: Ohad Bitton <ohbitton@microsoft.com>
2020-05-05 12:47:59 +03:00
amshalev 34cf443231
E2E Test (#130)
* e2e

* working version

* try to fix build

* fix paths issues

* exclude e2e test

* CR fix + renaming to TestDataItem
2020-04-19 12:42:22 +03:00
amshalev fbc012d2f9
Fix - ColumnMapping serialization (#129)
* Fix - ColumnMapping serialization

* fix pom

* pom fix seecond try
2020-04-16 12:49:23 +03:00
ohad bitton 6ad0321f0f
Update KustoResultSetTable.java (#128)
* Update KustoResultSetTable.java

* Update pom.xml
2020-04-12 14:44:15 +03:00