Skip to content

Conversation

@vinothchandar
Copy link
Member

Tips

What is the purpose of the pull request

(For example: This pull request adds quick-start document.)

Brief change log

(for example:)

  • Modify AnnotationLocation checkstyle rule in checkstyle.xml

Verify this pull request

(Please pick either of the following options)

This pull request is a trivial rework / code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end.
  • Added HoodieClientWriteTest to verify the change.
  • Manually verified the change by running a job locally.

Committer checklist

  • Has a corresponding JIRA in PR title & commit

  • Commit message is descriptive of the change

  • CI is green

  • Necessary doc changes done or have another open PR

  • For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

@vinothchandar vinothchandar added the status:in-progress Work in progress label Sep 10, 2020
@vinothchandar vinothchandar self-assigned this Sep 10, 2020
@vinothchandar vinothchandar changed the title hudi cluster write path poc [WIP] hudi cluster write path poc Sep 17, 2020
Copy link
Contributor

@bvaradar bvaradar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yet to finish up a pass. Adding comments so far.

Once REPLACE action (@satishkotha) changes are coalesced with this change (#2048), this would simplify.

The naming "cluster" vs "clustering" needs to be standardized.


@Override
protected void addPendingClusteringOperations(Stream<Pair<String, ClusteringOperation>> operations) {
// TODO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO and others are needed for incremental filesystem view syncing.

return fileIdToPendingCompaction;
}

protected Map<HoodieFileGroupId, Pair<String, ClusteringOperation>> createFileIdToPendingClusteringMap(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be a good idea to rebase this with #2048 as it is almost ready.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense

} else {
return HoodieTimeline.makeCommitFileName(timestamp);
}
} else if (HoodieTimeline.CLUSTERING_ACTION.equals(action)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am assuming this would be changed to REPLACE_ACTION from the other PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense

.collect(Collectors.toSet());
List<HoodieClusteringOperation> operations = jsc.parallelize(partitionPaths, partitionPaths.size()).map((Function<String, ClusteringOperation>) partitionPath -> {
Stream<FileSlice> fileSliceStream = fileSystemView.getLatestFileSlices(partitionPath);
List<HoodieBaseFile> baseFiles = fileSliceStream.filter(slice -> (!fgIdsInPendingClusterings.contains(slice.getFileGroupId()) && !fgIdsPendingCompactions.contains(slice.getFileGroupId())))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For COW table, pending compactions would not be present.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the code seems common with Compaction handling. Any chance of moving to common helper functions ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, will reuse these code

}

@Override
public int compare(HoodieClusteringOperation op1, HoodieClusteringOperation op2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be moved to separate comparator class ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

String partitionPath = partitionStat.getKey();
String fileId = updateLocEntry.getKey();
if (partitionFileIdPairs.contains(Pair.of(partitionPath, fileId))) {
LOG.error("Not allowed to update the clustering files, partition: " + partitionPath + ", fileID " + fileId + ", please use other strategy.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"please use other strategy" => Reword ? FOr pending clustering operations, we are not going to support update for now right ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, first step will not support update when clustering

* See the License for the specific language governing permissions and
* limitations under the License.
*/
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to reuse Replace metadata or this one ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

INFLIGHT_DELTA_COMMIT_EXTENSION, REQUESTED_DELTA_COMMIT_EXTENSION, SAVEPOINT_EXTENSION,
INFLIGHT_SAVEPOINT_EXTENSION, CLEAN_EXTENSION, REQUESTED_CLEAN_EXTENSION, INFLIGHT_CLEAN_EXTENSION,
INFLIGHT_COMPACTION_EXTENSION, REQUESTED_COMPACTION_EXTENSION, INFLIGHT_RESTORE_EXTENSION, RESTORE_EXTENSION));
INFLIGHT_COMPACTION_EXTENSION, REQUESTED_COMPACTION_EXTENSION, INFLIGHT_RESTORE_EXTENSION, RESTORE_EXTENSION,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to reuse REPLACE action here ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sense

return fileIdToPendingCompaction;
}

protected Map<HoodieFileGroupId, Pair<String, ClusteringOperation>> createFileIdToPendingClusteringMap(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming we are going to reuse REPLACE, many of these changes should go away ?

public HoodieWriteMetadata clustering(JavaSparkContext jsc, String compactionInstantTime) {
return new RunClusteringActionExecutor(jsc, config, this, compactionInstantTime).execute();
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to ensure small file handling doesn't toe-step clustering. In other words, we should employ update rejection policy for small file handling too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Will pay attention to this

@satishkotha
Copy link
Member

@leesf #2048 is landed. is it possible to merge this and address Balaji's comments? (I can help if needed)

@leesf
Copy link
Contributor

leesf commented Oct 2, 2020

@leesf #2048 is landed. is it possible to merge this and address Balaji's comments? (I can help if needed)

Sure, considering I am a little busy these days, it is wonderful if you @satishkotha would take over the PR and land it. Thanks

@lw309637554
Copy link
Contributor

lw309637554 commented Oct 12, 2020

@leesf #2048 is landed. is it possible to merge this and address Balaji's comments? (I can help if needed)

Sure, considering I am a little busy these days, it is wonderful if you @satishkotha would take over the PR and land it. Thanks

@leesf @satishkotha what is your process? i am intrested to take this and land it. Thanks

@satishkotha
Copy link
Member

@leesf #2048 is landed. is it possible to merge this and address Balaji's comments? (I can help if needed)

Sure, considering I am a little busy these days, it is wonderful if you @satishkotha would take over the PR and land it. Thanks

@leesf @satishkotha what is your process? i am intrested to take this and land it. Thanks

@lw309637554 I've already started working on this. Perhaps, you could help with one of the followup tasks of #2048? These are tracked as subtasks here https://issues.apache.org/jira/browse/HUDI-868? Subtasks 2,4 are easy to get started. But, feel free to pick others too?

@vinothchandar Maybe we can close this PR to avoid confusion? I'll open new PR when i'm ready and run some basic tests.

@lw309637554
Copy link
Contributor

@leesf #2048 is landed. is it possible to merge this and address Balaji's comments? (I can help if needed)

Sure, considering I am a little busy these days, it is wonderful if you @satishkotha would take over the PR and land it. Thanks

@leesf @satishkotha what is your process? i am intrested to take this and land it. Thanks

@lw309637554 I've already started working on this. Perhaps, you could help with one of the followup tasks of #2048? These are tracked as subtasks here https://issues.apache.org/jira/browse/HUDI-868? Subtasks 2,4 are easy to get started. But, feel free to pick others too?

@vinothchandar Maybe we can close this PR to avoid confusion? I'll open new PR when i'm ready and run some basic tests.

@satishkotha ok, i can take some sub task in https://issues.apache.org/jira/browse/HUDI-868

@vinothchandar
Copy link
Member Author

Closing this , since we have the actual PR now from @satishkotha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:in-progress Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants