-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Reduce Disk Footprint for Segment Processor Framework to Avoid Out of Disk Issues #12220
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
Merged
snleee
merged 34 commits into
apache:master
from
aishikbh:reduceDiskFootprintForSegmentProcessorFramework
Jan 24, 2024
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
4f30528
modularized map, reduce and segment generation phase.
aishikbh 287d555
added interfaces and classes
aishikbh c87bca1
added staetefulrecordreaderfileconfig instead of recordreaderfileconfig
aishikbh dc4f0d7
save Progress
aishikbh ac45173
major changes, working tests.
aishikbh 0f42cc8
more changes
aishikbh 14749a5
made the number of bytes to be configurable
aishikbh 4a7fbf9
added global sequence id to segments since it is modularised out, mad…
aishikbh 6c20856
remove logic for global segment IDs.
aishikbh f2d611a
used recordreaderconfig instead of statefulrecordreaderconfig, change…
aishikbh a302437
added proper sequence ids for segments.
aishikbh 3841daa
ingestion working without errors. Should be good in sunny day scenarios.
aishikbh f28858d
remove typo from testing
aishikbh 1eacc73
replace _partitionToFilemanagerMap with local variable asthe mapping …
aishikbh 72302e0
added precondition check for intermediateFileSizeThresholdInBytes and…
aishikbh 0a114b1
fix typo and add comment.
aishikbh 6c768ad
removed redundant method.
aishikbh 209999a
config related changes, fix unit tests.
aishikbh 8824749
remove redundant flag.
aishikbh 73a097c
replaced size based constraint checker with size based constraint wri…
aishikbh a1914dc
consolidated all the constraint checks into one place.
aishikbh 35813dd
add test to validate segmentprocessorframework
aishikbh a7e1eb4
decoupled recordreader closing logic from segment mapper
aishikbh 8764692
addressing comments related to segmentprocessorframework.
aishikbh 90743f1
delegated initialisation and check for recordreader being done with a…
aishikbh ee1ea18
simplify logic for termination of map phase.
aishikbh 70a3ad0
change variable names for better readability.
aishikbh 9664cd4
Added tests and minor changes in logic
aishikbh d7dec36
isolated the termination logs to mapAndTransformRow.
aishikbh ebe0818
Keep SegmentMapper public interface unchanged
aishikbh 1bdf470
addressing review comments.
aishikbh 5a8f959
cleaned up logging logic.
aishikbh f7f783b
Channged Logs
aishikbh 2d98e31
modify tests
aishikbh 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
This file contains hidden or 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 hidden or 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 hidden or 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
33 changes: 33 additions & 0 deletions
33
...n/java/org/apache/pinot/core/segment/processing/genericrow/AdaptiveConstraintsWriter.java
This file contains hidden or 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,33 @@ | ||
| /** | ||
| * 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.core.segment.processing.genericrow; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
|
|
||
| /** | ||
| * Interface for a writer which can track constraints. This will be used by SegmentProcessorFramework. | ||
| * */ | ||
|
|
||
| public interface AdaptiveConstraintsWriter<W, D> { | ||
aishikbh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| boolean canWrite(); | ||
|
|
||
| void write(W writer, D dataUnit) | ||
| throws IOException; | ||
| } | ||
51 changes: 51 additions & 0 deletions
51
...ain/java/org/apache/pinot/core/segment/processing/genericrow/AdaptiveSizeBasedWriter.java
This file contains hidden or 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,51 @@ | ||
| /** | ||
| * 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.core.segment.processing.genericrow; | ||
|
|
||
| import java.io.IOException; | ||
| import org.apache.pinot.spi.data.readers.GenericRow; | ||
|
|
||
|
|
||
| public class AdaptiveSizeBasedWriter implements AdaptiveConstraintsWriter<GenericRowFileWriter, GenericRow> { | ||
|
|
||
| private final long _bytesLimit; | ||
| private long _numBytesWritten; | ||
|
|
||
| public AdaptiveSizeBasedWriter(long bytesLimit) { | ||
| _bytesLimit = bytesLimit; | ||
| _numBytesWritten = 0; | ||
| } | ||
|
|
||
| public long getBytesLimit() { | ||
| return _bytesLimit; | ||
| } | ||
| public long getNumBytesWritten() { | ||
| return _numBytesWritten; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean canWrite() { | ||
| return _numBytesWritten < _bytesLimit; | ||
| } | ||
|
|
||
| @Override | ||
| public void write(GenericRowFileWriter writer, GenericRow row) throws IOException { | ||
| _numBytesWritten += writer.writeData(row); | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.