-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Spotless] Applying Google Code Format for core/src/main files #2 #313
[Spotless] Applying Google Code Format for core/src/main files #2 #313
Conversation
Codecov Report
@@ Coverage Diff @@
## integ/sl_GoogleJavaFormat2 #313 +/- ##
================================================================
- Coverage 97.39% 97.34% -0.06%
+ Complexity 4603 4405 -198
================================================================
Files 401 371 -30
Lines 11397 11129 -268
Branches 835 774 -61
================================================================
- Hits 11100 10833 -267
+ Misses 290 289 -1
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 29 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Checkstyle fails for some of the changes. |
b698850
to
b8aea35
Compare
* Use this unresolved plan visitor to check if a plan can be serialized by PaginatedPlanCache. If | ||
* | ||
* <pre>plan.accept(new CanPaginateVisitor(...))</pre> | ||
* | ||
* returns <em>true</em>, then PaginatedPlanCache.convertToCursor will succeed. Otherwise, it will | ||
* fail. The purpose of this visitor is to activate legacy engine fallback mechanism. Currently, V2 | ||
* engine does not support queries with: - aggregation (GROUP BY clause or aggregation functions | ||
* like min/max) - in memory aggregation (window function) - LIMIT/OFFSET clause(s) - without FROM | ||
* clause - JOIN - a subquery V2 also requires that the table being queried should be an OpenSearch | ||
* index. See PaginatedPlanCache.canConvertToCursor for usage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you need to add more pre tags to this take make all of the lines not lose formatting
* @param visitor visitor | ||
* @param context context | ||
* @param <T> result type | ||
* @param <C> context type | ||
* @return result accumulated by visitor when visiting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would adding pre tags here help fix the even spacing from being lost?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would, but I don't think it's worth it as @oaram are important parts of Javadocs so I think we shouldn't mess with it.
* @param node function node | ||
* @param context context | ||
* @return result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another spacing issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's an improvement removing the extra spaces
* Call visitFunction() by default rather than visitChildren(). This makes CASE/WHEN able to be | ||
* handled: 1) by visitFunction() if not overwritten: ex. FilterQueryBuilder 2) by | ||
* visitCase/When() otherwise if any special logic: ex. ExprReferenceOptimizer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs pre tags
* @param <T> type of return value to accumulate when visiting. | ||
* @param <C> type of context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically the spacing on this one is still fine because both lines have the same length but still should have pre
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes a difference?
* Named expression that represents expression with name. Please see more details in associated | ||
* unresolved expression operator {@link org.opensearch.sql.ast.expression.Alias}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs pre
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved.
* Resolve the ExprValue from {@link ExprTupleValue} using paths. Considering the following sample | ||
* data. { "name": "bob smith" "project.year": 1990, "project": { "year": "2020" } "address": { | ||
* "state": "WA", "city": "seattle", "project.year": 1990 } "address.local": { "state": "WA", } } | ||
* The paths could be 1. top level, e.g. "name", which will be resolved as "bob smith" 2. multiple | ||
* paths, e.g. "name.address.state", which will be resolved as "WA" 3. special case, the "." is | ||
* the path separator, but it is possible that the path include ".", for handling this use case, | ||
* we define the resolve rule as bellow, e.g. "project.year" is resolved as 1990 instead of 2020. | ||
* Note. This logic only applied top level none object field. e.g. "address.local.state" been | ||
* resolved to Missing. but "address.project.year" could been resolved as 1990. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs pre
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved.
* 3) Sliding window frame that maintains a sliding window of fixed size | ||
* Note that which type of window frame is used is determined by both window function itself | ||
* and frame definition in a window definition. | ||
* Window frame that represents a subset of a window which is all data accessible to the window |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved.
@@ -82,11 +75,10 @@ public ExprValue current() { | |||
/** | |||
* Preload all peer rows if last peer rows done. Note that when no more data in peeking iterator, | |||
* there must be rows in frame (hasNext()=true), so no need to check it.hasNext() in this method. | |||
* Load until: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
* 1. Ranking window functions: ignore frame definition and always operates on | ||
* previous and current row. | ||
* 2. Aggregate window functions: frame partition into peers and sliding window is not supported. | ||
* Create specific window frame based on window definition and what's current window function. For |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* The definition of text functions. | ||
* 1) have the clear interface for function define. | ||
* 2) the implementation should rely on ExprValue. | ||
* The definition of text functions. 1) have the clear interface for function define. 2) the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* float/double integer float/double (field type) | ||
* float/double double float/double (field type) | ||
* other any field type | ||
* Return type follows the following table. FIELD VALUE RETURN_TYPE int/long integer int/long |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* NULL NULL | ||
* MISSING MISSING | ||
*/ | ||
/** The not logic. A NOT A TRUE FALSE FALSE TRUE NULL NULL MISSING MISSING */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL a not a true false false true null null missing missing.
Needs tags as well
* FALSE MISSING MISSING | ||
* NULL NULL NULL | ||
* NULL MISSING NULL | ||
* The xor logic. A B A AND B TRUE TRUE FALSE TRUE FALSE TRUE TRUE NULL TRUE TRUE MISSING TRUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* NULL NULL NULL | ||
* NULL MISSING NULL | ||
* MISSING MISSING MISSING | ||
* The or logic. A B A AND B TRUE TRUE TRUE TRUE FALSE TRUE TRUE NULL TRUE TRUE MISSING TRUE FALSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* FALSE MISSING FALSE | ||
* NULL NULL NULL | ||
* NULL MISSING MISSING | ||
* The and logic. A B A AND B TRUE TRUE TRUE TRUE FALSE FALSE TRUE NULL NULL TRUE MISSING MISSING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* or, Accepts two Boolean values and produces a Boolean. | ||
* xor, Accepts two Boolean values and produces a Boolean. | ||
* equalTo, Compare the left expression and right expression and produces a Boolean. | ||
* The definition of binary predicate function and, Accepts two Boolean values and produces a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* The supported signature of floor function is | ||
* (STRING, INTEGER, INTEGER) -> STRING | ||
* (INTEGER, INTEGER, INTEGER) -> STRING | ||
* Definition of conv(x, a, b) function. Convert number x from base a to base b The supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* The definition of date and time functions. | ||
* 1) have the clear interface for function define. | ||
* 2) the implementation should rely on ExprValue. | ||
* The definition of date and time functions. 1) have the clear interface for function define. 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* (TIME, INTERVAL) -> TIME // when interval has no date part | ||
* (STRING, INTERVAL) -> STRING // when argument has date or datetime string, | ||
* // result has date or datetime depending on interval type | ||
* A common signature for `date_add` and `date_sub`. Specify a start date and add/subtract a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* Adds/subtracts an integer number of days to/from the first argument. | ||
* (DATE, LONG) -> DATE | ||
* (TIME/DATETIME/TIMESTAMP, LONG) -> DATETIME | ||
* A common signature for `adddate` and `subdate`. Adds/subtracts an integer number of days |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* (STRING, STRING/TIME) -> STRING // second arg - string with time only | ||
* (x, STRING) -> NULL // second arg - string with timestamp | ||
* (x, STRING/DATE) -> x // second arg - string with date only | ||
* Adds expr2 to expr1 and returns the result. (TIME, TIME/DATE/DATETIME/TIMESTAMP) -> TIME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* (x, x) -> NULL // when args have different types | ||
* (STRING, STRING) -> TIME // argument strings contain same types only | ||
* (STRING, STRING) -> NULL // argument strings are different types | ||
* Returns different between two times as a time. (TIME, TIME) -> TIME MySQL has these signatures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* (DATETIME, STRING) -> STRING | ||
* (TIME, STRING) -> STRING | ||
* (TIMESTAMP, STRING) -> STRING | ||
* Formats date according to format specifier. First argument is time, second is format. Detailed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
* - negative year is not accepted | ||
* - @dayOfYear should be greater than 1 | ||
* - if @dayOfYear is greater than 365/366, calculation goes to the next year(s) | ||
* Furthermore: - zero year interpreted as 2000 - negative year is not accepted - @dayOfYear |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tags as well
45fe539
to
66c98ae
Compare
/** | ||
* Call visitFunction() by default rather than visitChildren(). | ||
* This makes CASE/WHEN able to be handled: | ||
* * <ol> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have added a new * here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
* (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE) | ||
* -> wider type between types of x and y | ||
* Definition of divide(x, y) function. Returns the number x divided by number y The supported | ||
* signature of divide function is (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add
tags here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
* (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE) | ||
* -> wider type between types of x and y | ||
* Definition of modulus(x, y) function. Returns the number x modulo by number y The supported | ||
* signature of modulo function is (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add
tags here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
* (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE) | ||
* -> wider type between types of x and y | ||
* Definition of multiply(x, y) function. Returns the number x multiplied by number y The | ||
* supported signature of multiply function is (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add
tags here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
* The supported signature of subtract function is | ||
* (x: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE, y: BYTE/SHORT/INTEGER/LONG/FLOAT/DOUBLE) | ||
* -> wider type between types of x and y | ||
* Definition of subtract(x, y) function. Returns the number x minus number y The supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add
tags here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
* The supported signature of mod function is | ||
* (x: INTEGER/LONG/FLOAT/DOUBLE, y: INTEGER/LONG/FLOAT/DOUBLE) | ||
* -> wider type between types of x and y | ||
* Definition of mod(x, y) function. Calculate the remainder of x divided by y The supported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add
tags here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
core/src/main/java/org/opensearch/sql/expression/operator/arthmetic/MathematicalFunction.java
Outdated
Show resolved
Hide resolved
* Definition of atan(x) and atan(y, x) function. atan(x) calculates the arc tangent of x, that | ||
* is, the value whose tangent is x. atan(y, x) calculates the arc tangent of y / x, except that | ||
* the signs of both arguments are used to determine the quadrant of the result. The supported | ||
* signature of atan function is (x: INTEGER/LONG/FLOAT/DOUBLE, y: INTEGER/LONG/FLOAT/DOUBLE) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add
tags here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
8394d4e
to
70688c7
Compare
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
…erator.java ExpressionNodeVisitor.java StreamingQueryPlan.java Signed-off-by: Mitchell Gale <[email protected]>
…on.java QualifiedName.java Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
7b281a6
to
326671f
Compare
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already included this file in part 1 in #312
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also present in #312 with other changes
*/ | ||
public class NoCursorException extends RuntimeException { | ||
} | ||
public class NoCursorException extends RuntimeException {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{}
will conflict with checkstyle
* Execute physical plan and call back response listener. Todo. deprecated this interface after | ||
* finalize {@link ExecutionContext}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Execute physical plan and call back response listener. Todo. deprecated this interface after | |
* finalize {@link ExecutionContext}. | |
* Execute physical plan and call back response listener.<br /> | |
* TODO: deprecate this interface after finalize {@link ExecutionContext}. |
* Execute the {@link UnresolvedPlan}, using {@link ResponseListener} to get response. Todo. | ||
* deprecated this interface after finalize {@link PlanContext}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Execute the {@link UnresolvedPlan}, using {@link ResponseListener} to get response. Todo. | |
* deprecated this interface after finalize {@link PlanContext}. | |
* Execute the {@link UnresolvedPlan}, using {@link ResponseListener} to get response.<br /> | |
* TODO: deprecate this interface after finalize {@link PlanContext}. |
@@ -87,6 +132,7 @@ public static void register(BuiltinFunctionRepository repository) { | |||
.build(); | |||
|
|||
/** | |||
* <pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a table too?
@@ -115,6 +162,7 @@ public static void register(BuiltinFunctionRepository repository) { | |||
.build(); | |||
|
|||
/** | |||
* <pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a table too?
} | ||
|
||
/** | ||
* <pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a table too?
return rounding.round(field.valueOf(valueEnv)); | ||
} | ||
|
||
/** | ||
* <pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a table?
* REPLACE(str, from_str, to_str) returns the string str with all occurrences of | ||
* the string from_str replaced by the string to_str. | ||
* REPLACE() performs a case-sensitive match when searching for from_str. | ||
* Supports following signature: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe: add <br />
to put signature on the next line (for all functions)
* Implement creation of ip2geo feature (#257) * Update gradle version to 7.6 (#265) Signed-off-by: Vijayan Balasubramanian <[email protected]> * Implement creation of ip2geo feature * Implementation of ip2geo datasource creation * Implementation of ip2geo processor creation Signed-off-by: Heemin Kim <[email protected]> --------- Signed-off-by: Vijayan Balasubramanian <[email protected]> Signed-off-by: Heemin Kim <[email protected]> Co-authored-by: Vijayan Balasubramanian <[email protected]> * Added unit tests with some refactoring of codes (#271) * Add Unit tests * Set cache true for search query * Remove in memory cache implementation (Two way door decision) * Relying on search cache without custom cache * Renamed datasource state from FAILED to CREATE_FAILED * Renamed class name from *Helper to *Facade * Changed updateIntervalInDays to updateInterval * Changed value type of default update_interval from TimeValue to Long * Read setting value from cluster settings directly Signed-off-by: Heemin Kim <[email protected]> * Sync from main (#280) * Update gradle version to 7.6 (#265) Signed-off-by: Vijayan Balasubramanian <[email protected]> * Exclude lombok generated code from jacoco coverage report (#268) Signed-off-by: Heemin Kim <[email protected]> * Make jacoco report to be generated faster in local (#267) Signed-off-by: Heemin Kim <[email protected]> * Update dependency org.json:json to v20230227 (#273) Co-authored-by: mend-for-github.aaakk.us.kg[bot] <50673670+mend-for-github.aaakk.us.kg[bot]@users.noreply.github.com> * Baseline owners and maintainers (#275) Signed-off-by: Vijayan Balasubramanian <[email protected]> --------- Signed-off-by: Vijayan Balasubramanian <[email protected]> Signed-off-by: Heemin Kim <[email protected]> Co-authored-by: Vijayan Balasubramanian <[email protected]> Co-authored-by: mend-for-github.aaakk.us.kg[bot] <50673670+mend-for-github.aaakk.us.kg[bot]@users.noreply.github.com> * Add datasource name validation (#281) Signed-off-by: Heemin Kim <[email protected]> * Refactoring of code (#282) 1. Change variable name from datasourceName to name 2. Change variable name from id to name 3. Added helper methods in test code Signed-off-by: Heemin Kim <[email protected]> * Change field name from md5 to sha256 (#285) Signed-off-by: Heemin Kim <[email protected]> * Implement get datasource api (#279) Signed-off-by: Heemin Kim <[email protected]> * Update index option (#284) 1. Make geodata index as hidden 2. Make geodata index as read only allow delete after creation is done 3. Refresh datasource index immediately after update Signed-off-by: Heemin Kim <[email protected]> * Make some fields in manifest file as mandatory (#289) Signed-off-by: Heemin Kim <[email protected]> * Create datasource index explicitly (#283) Signed-off-by: Heemin Kim <[email protected]> * Add wrapper class of job scheduler lock service (#290) Signed-off-by: Heemin Kim <[email protected]> * Remove all unused client attributes (#293) Signed-off-by: Heemin Kim <[email protected]> * Update copyright header (#298) Signed-off-by: Heemin Kim <[email protected]> * Run system index handling code with stashed thread context (#297) Signed-off-by: Heemin Kim <[email protected]> * Reduce lock duration and renew the lock during update (#299) Signed-off-by: Heemin Kim <[email protected]> * Implements delete datasource API (#291) Signed-off-by: Heemin Kim <[email protected]> * Set User-Agent in http request (#300) Signed-off-by: Heemin Kim <[email protected]> * Implement datasource update API (#292) Signed-off-by: Heemin Kim <[email protected]> * Refactoring test code (#302) Make buildGeoJSONFeatureProcessorConfig method to be more general Signed-off-by: Heemin Kim <[email protected]> * Add ip2geo processor integ test for failure case (#303) Signed-off-by: Heemin Kim <[email protected]> * Bug fix and refactoring of code (#305) 1. Bugfix: Ingest metadata can be null if there is no processor created 2. Refactoring: Moved private method to another class for better testing support 3. Refactoring: Set some private static final variable as public so that unit test can use it 4. Refactoring: Changed string value to static variable Signed-off-by: Heemin Kim <[email protected]> * Add integration test for Ip2GeoProcessor (#306) Signed-off-by: Heemin Kim <[email protected]> * Add ConcurrentModificationException (#308) Signed-off-by: Heemin Kim <[email protected]> * Add integration test for UpdateDatasource API (#307) Signed-off-by: Heemin Kim <[email protected]> * Bug fix on lock management and few performance improvements (#310) * Release lock before response back to caller for update/delete API * Release lock in background task for creation API * Change index settings to improve indexing performance Signed-off-by: Heemin Kim <[email protected]> * Change index setting from read_only_allow_delete to write (#311) read_only_allow_delete does not block write to an index. The disk-based shard allocator may add and remove this block automatically. Therefore, use index.blocks.write instead. Signed-off-by: Heemin Kim <[email protected]> * Fix bug in get datasource API and improve memory usage (#313) Signed-off-by: Heemin Kim <[email protected]> * Change package for Strings.hasText (#314) (#317) Signed-off-by: Heemin Kim <[email protected]> * Remove jitter and move index setting from DatasourceFacade to DatasourceExtension (#319) Signed-off-by: Heemin Kim <[email protected]> * Do not index blank value and do not enrich null property (#320) Signed-off-by: Heemin Kim <[email protected]> * Move index setting keys to constants (#321) Signed-off-by: Heemin Kim <[email protected]> * Return null index name for expired data (#322) Return null index name for expired data so that it can be deleted by clean up process. Clean up process exclude current index from deleting. Signed-off-by: Heemin Kim <[email protected]> * Add new fields in datasource (#325) Signed-off-by: Heemin Kim <[email protected]> * Delete index once it is expired (#326) Signed-off-by: Heemin Kim <[email protected]> * Add restoring event listener (#328) In the listener, we trigger a geoip data update Signed-off-by: Heemin Kim <[email protected]> * Reverse forcemerge and refresh order (#331) Otherwise, opensearch does not clear old segment files Signed-off-by: Heemin Kim <[email protected]> * Removed parameter and settings (#332) * Removed first_only parameter * Removed max_concurrency and batch_size setting first_only parameter was added as current geoip processor has it. However, the parameter have no benefit for ip2geo processor as we don't do a sequantial search for array data but use multi search. max_concurrency and batch_size setting is removed as these are only reveal internal implementation and could be a future blocker to improve performance later. Signed-off-by: Heemin Kim <[email protected]> * Add a field in datasource for current index name (#333) Signed-off-by: Heemin Kim <[email protected]> * Delete GeoIP data indices after restoring complete (#334) We don't want to use restored GeoIP data indices. Therefore we delete the indices once restoring process complete. When GeoIP metadata index is restored, we create a new GeoIP data index instead. Signed-off-by: Heemin Kim <[email protected]> * Use bool query for array form of IPs (#335) Signed-off-by: Heemin Kim <[email protected]> * Run update/delete request in a new thread (#337) This is not to block transport thread Signed-off-by: Heemin Kim <[email protected]> * Remove IP2Geo processor validation (#336) Cannot query index to get data to validate IP2Geo processor. Will add validation when we decide to store some of data in cluster state metadata. Signed-off-by: Heemin Kim <[email protected]> * Acquire lock sychronously (#339) By acquiring lock asychronously, the remaining part of the code is being run by transport thread which does not allow blocking code. We want only single update happen in a node using single thread. However, it cannot be acheived if I acquire lock asynchronously and pass the listener. Signed-off-by: Heemin Kim <[email protected]> * Added a cache to store datasource metadata (#338) Signed-off-by: Heemin Kim <[email protected]> * Changed class name and package (#341) Signed-off-by: Heemin Kim <[email protected]> * Refactoring of code (#342) 1. Changed class name from Ip2GeoCache to Ip2GeoCachedDao 2. Moved the Ip2GeoCachedDao from cache to dao package Signed-off-by: Heemin Kim <[email protected]> * Add geo data cache (#340) Signed-off-by: Heemin Kim <[email protected]> * Add cache layer to reduce GeoIp data retrieval latency (opensearch-project#343) Signed-off-by: Heemin Kim <[email protected]> * Use _primary in query preference and few changes (opensearch-project#347) 1. Use _primary preference to get datasource metadata so that it can read the latest data. RefreshPolicy.IMMEDIATE won't refresh replica shards immediately according to #346 2. Update datasource metadata index mapping 3. Move batch size from static value to setting Signed-off-by: Heemin Kim <[email protected]> * Wait until GeoIP data to be replicated to all data nodes (opensearch-project#348) Signed-off-by: Heemin Kim <[email protected]> * Update packages according to a change in OpenSearch core (opensearch-project#354) * Update packages according to a change in OpenSearch core Signed-off-by: Heemin Kim <[email protected]> * Update packages according to a change in OpenSearch core (opensearch-project#353) Signed-off-by: Heemin Kim <[email protected]> --------- Signed-off-by: Heemin Kim <[email protected]> --------- Signed-off-by: Vijayan Balasubramanian <[email protected]> Signed-off-by: Heemin Kim <[email protected]> Co-authored-by: Vijayan Balasubramanian <[email protected]> Co-authored-by: mend-for-github.aaakk.us.kg[bot] <50673670+mend-for-github.aaakk.us.kg[bot]@users.noreply.github.com>
Description
This PR applies Spotless on Java code for:
core/src/main/java/org/opensearch/sql/exception
core/src/main/java/org/opensearch/sql/executor
core/src/main/java/org/opensearch/sql/expression
core/src/main/java/org/opensearch/sql/monitor
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.