-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Supports Force Committing Segments in Batches #14811
Open
noob-se7en
wants to merge
73
commits into
apache:master
Choose a base branch
from
noob-se7en:add_batch_force_commit
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+406
−6
Open
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
eeb5be1
Supports batching in ForceCommit API
noob-se7en 5f5a554
nit
noob-se7en ca5104a
Refactoring
noob-se7en 434e8a3
nit
noob-se7en 504f3c9
nit
noob-se7en 987bb00
nit
noob-se7en ff25c5f
nit
noob-se7en e28ff47
nit
noob-se7en 99a7cee
nit
noob-se7en 255bc34
lint
noob-se7en 3a9e41a
nit
noob-se7en b2eeb85
fixes lint
noob-se7en 1782207
nit
noob-se7en 90db3b8
Merge branch 'master' of github.com:Harnoor7/pinot into add_batch_for…
noob-se7en fa418b9
refactoring
noob-se7en 470c6eb
refactoring
noob-se7en 8de7bfc
fixes bug
noob-se7en 4f2d4fc
nit
noob-se7en 50af02e
nit
noob-se7en 09d557e
nit
noob-se7en 32b7fd5
nit
noob-se7en e334983
nit
noob-se7en 1aecc5a
fix_bug
noob-se7en 5be2722
Adds scheduling logic in controller
noob-se7en 153a897
nit
noob-se7en 430127d
fixes lint
noob-se7en f20948e
fixes bug
noob-se7en 5012b5f
nit
noob-se7en c2312d2
nit
noob-se7en 49474f5
fix bug
noob-se7en ab2220f
Updates foceCommit API to handle Pauseless
noob-se7en ed90f11
updates metadata
noob-se7en e88aa2a
fixes lint
noob-se7en 8c8d8d3
adds tests
noob-se7en 1be0316
saves 1 zk call
noob-se7en 55fa6e2
Merge branch 'update_forceCommit_status' of github.com:Harnoor7/pinot…
noob-se7en 3297ddd
updates log
noob-se7en 748d0d3
Adds tests
noob-se7en 095acc0
Addresses PR comments
noob-se7en 36360b8
nit
noob-se7en d3d42ca
Merge branch 'update_forceCommit_status' of github.com:Harnoor7/pinot…
noob-se7en 262bee0
pulls latest changes for pauseless
noob-se7en 68cdc26
adds unit test
noob-se7en 9f833c6
Merge branch 'update_forceCommit_status' of github.com:Harnoor7/pinot…
noob-se7en f5d68ae
addresses comment
noob-se7en bffab6d
Merge branch 'master' of github.com:apache/pinot into add_batch_force…
noob-se7en a1079c2
Addresses Pr comment
noob-se7en b8a2e7f
Merge branch 'master' of github.com:apache/pinot into update_forceCom…
noob-se7en 5730a06
addresses PR comments
noob-se7en c8565d6
nit
noob-se7en 165e7ab
Merge branch 'update_forceCommit_status' of github.com:Harnoor7/pinot…
noob-se7en 0cab772
refactoring
noob-se7en de04824
Addresses PR comments
noob-se7en b95a2f6
nit
noob-se7en 857dd6a
attempt to fix test
noob-se7en 2f7e5d9
Merge branch 'master' of github.com:apache/pinot into update_forceCom…
noob-se7en 0b64439
nit
noob-se7en 9e3ddad
Attempts to fix test
noob-se7en 01604e9
Merge branch 'update_forceCommit_status' of github.com:Harnoor7/pinot…
noob-se7en bb84ae2
Merge branch 'master' of github.com:apache/pinot into add_batch_force…
noob-se7en 71f4ee1
Attempts to fix test
noob-se7en 2408d13
attempt to fix test
noob-se7en ff67929
Addresses PR comments
noob-se7en 80dda07
Adds timeout and interval query parameters in API
noob-se7en 11299f4
nit
noob-se7en ad7aec0
fixes lint
noob-se7en 7ea5535
Adds unit test
noob-se7en 5ea7c3f
nit
noob-se7en 6907c8f
Addresses PR comments
noob-se7en 2a61ce4
attempts to fix test
noob-se7en 445efbc
speeds up test
noob-se7en 444fc49
Attempts to fix test
noob-se7en e7ab323
nit
noob-se7en File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
...oller/src/main/java/org/apache/pinot/controller/api/resources/ForceCommitBatchConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.pinot.controller.api.resources; | ||
|
||
public class ForceCommitBatchConfig { | ||
|
||
private static final int DEFAULT_BATCH_SIZE = Integer.MAX_VALUE; | ||
private static final int DEFAULT_BATCH_STATUS_CHECK_INTERVAL_SEC = 5; | ||
private static final int DEFAULT_BATCH_STATUS_CHECK_TIMEOUT_SEC = 180; | ||
|
||
private final int _batchSize; | ||
private final int _batchStatusCheckIntervalMs; | ||
private final int _batchStatusCheckTimeoutMs; | ||
|
||
private ForceCommitBatchConfig(Integer batchSize, Integer batchStatusCheckIntervalMs, | ||
Integer batchStatusCheckTimeoutMs) { | ||
_batchSize = batchSize; | ||
_batchStatusCheckIntervalMs = batchStatusCheckIntervalMs; | ||
_batchStatusCheckTimeoutMs = batchStatusCheckTimeoutMs; | ||
} | ||
|
||
public static ForceCommitBatchConfig of(Integer batchSize, Integer batchStatusCheckIntervalSec, | ||
Integer batchStatusCheckTimeoutSec) { | ||
if (batchSize == null) { | ||
batchSize = DEFAULT_BATCH_SIZE; | ||
} else if (batchSize <= 0) { | ||
throw new IllegalArgumentException("Batch size should be greater than zero"); | ||
} | ||
|
||
if (batchStatusCheckIntervalSec == null) { | ||
batchStatusCheckIntervalSec = DEFAULT_BATCH_STATUS_CHECK_INTERVAL_SEC; | ||
} else if (batchStatusCheckIntervalSec <= 0) { | ||
throw new IllegalArgumentException("Batch status check interval should be greater than zero"); | ||
} | ||
|
||
if (batchStatusCheckTimeoutSec == null) { | ||
batchStatusCheckTimeoutSec = DEFAULT_BATCH_STATUS_CHECK_TIMEOUT_SEC; | ||
} else if (batchStatusCheckTimeoutSec <= 0) { | ||
throw new IllegalArgumentException("Batch status check timeout should be greater than zero"); | ||
} | ||
|
||
return new ForceCommitBatchConfig(batchSize, batchStatusCheckIntervalSec * 1000, batchStatusCheckTimeoutSec * 1000); | ||
} | ||
|
||
public int getBatchSize() { | ||
return _batchSize; | ||
} | ||
|
||
public int getBatchStatusCheckIntervalMs() { | ||
return _batchStatusCheckIntervalMs; | ||
} | ||
|
||
public int getBatchStatusCheckTimeoutMs() { | ||
return _batchStatusCheckTimeoutMs; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...r/src/test/java/org/apache/pinot/controller/api/resources/ForceCommitBatchConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.pinot.controller.api.resources; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
import static org.testng.Assert.assertThrows; | ||
|
||
|
||
public class ForceCommitBatchConfigTest { | ||
|
||
@Test | ||
public void testForceCommitBatchConfig() { | ||
ForceCommitBatchConfig forceCommitBatchConfig = ForceCommitBatchConfig.of(null, null, null); | ||
assert Integer.MAX_VALUE == forceCommitBatchConfig.getBatchSize(); | ||
assert 5000 == forceCommitBatchConfig.getBatchStatusCheckIntervalMs(); | ||
assert 180000 == forceCommitBatchConfig.getBatchStatusCheckTimeoutMs(); | ||
|
||
forceCommitBatchConfig = ForceCommitBatchConfig.of(1, null, null); | ||
assert 1 == forceCommitBatchConfig.getBatchSize(); | ||
assert 5000 == forceCommitBatchConfig.getBatchStatusCheckIntervalMs(); | ||
assert 180000 == forceCommitBatchConfig.getBatchStatusCheckTimeoutMs(); | ||
|
||
forceCommitBatchConfig = ForceCommitBatchConfig.of(1, 23, 37); | ||
assert 1 == forceCommitBatchConfig.getBatchSize(); | ||
assert 23000 == forceCommitBatchConfig.getBatchStatusCheckIntervalMs(); | ||
assert 37000 == forceCommitBatchConfig.getBatchStatusCheckTimeoutMs(); | ||
|
||
assertThrows(IllegalArgumentException.class, () -> ForceCommitBatchConfig.of(0, null, null)); | ||
assertThrows(IllegalArgumentException.class, () -> ForceCommitBatchConfig.of(32, 0, null)); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Smart!