Skip to content
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

Add regx pattern file filter for distributed load #18311

Merged
merged 5 commits into from
Oct 26, 2023

Conversation

JiamingMai
Copy link
Contributor

Add regx pattern file filter for distributed load.

Example:
The following request allows us to load the files under /test-load directory with "hello" prefix:
curl -X GET http://localhost:28080/v1/load?path=s3a://jiamingmai-test/test-load&opType=submit&verbose=true&fileFilterRegx=^hello.*

@JiamingMai JiamingMai self-assigned this Oct 20, 2023
@JiamingMai JiamingMai added the type-feature This issue is a feature request label Oct 20, 2023
@JiamingMai JiamingMai requested a review from jja725 October 20, 2023 14:30
@JiamingMai JiamingMai force-pushed the add-regx-pattern-file-filter branch from 332ad1a to 1b8a977 Compare October 20, 2023 16:18
Copy link
Contributor

@jja725 jja725 left a comment

Choose a reason for hiding this comment

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

Mostly LGTM. We need to add these filter information into journal entry so we can recover from crash. Also can we add a test for this? We can try to follow loadcommandTest

@@ -60,11 +62,23 @@ public Job<?> create() {
.ofNullable(AuthenticatedClientUser.getOrNull())
.map(User::getName);

Predicate<UfsStatus> predicate = Predicates.alwaysTrue();
Copy link
Contributor

Choose a reason for hiding this comment

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

These logic should also appear at JournaledLoadJobFactory so we can recover from journal entry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. I put these logic into JournaledLoadJobFactory.

UnderFileSystem ufs = mFs.getUfsManager().getOrAdd(new AlluxioURI(path),
UnderFileSystemConfiguration.defaults(Configuration.global()));
Iterable<UfsStatus> iterable = new UfsStatusIterable(ufs, path,
Optional.ofNullable(AuthenticatedClientUser.getOrNull()).map(User::getName),
Predicates.alwaysTrue());
predicate);
return new DoraLoadJob(path, user, UUID.randomUUID().toString(), bandwidth, partialListing,
Copy link
Contributor

Choose a reason for hiding this comment

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

We also want to put this filter information into DoraLoadJob so we can turn this job into a journal entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@JiamingMai JiamingMai force-pushed the add-regx-pattern-file-filter branch from 1409f44 to 598f723 Compare October 25, 2023 14:20
@JiamingMai JiamingMai requested a review from jja725 October 25, 2023 14:20
@JiamingMai
Copy link
Contributor Author

JiamingMai commented Oct 25, 2023

Mostly LGTM. We need to add these filter information into journal entry so we can recover from crash. Also can we add a test for this? We can try to follow loadcommandTest

Updated. Tests are added in DoraLoadCommandIntegrationTest.

# Conflicts:
#	dora/core/server/master/src/main/java/alluxio/master/job/JournalLoadJobFactory.java
Copy link
Contributor

@jja725 jja725 left a comment

Choose a reason for hiding this comment

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

LGTM, one minor test verification needed

Thread.sleep(1000);
}
assertTrue(mOutput.toString().contains("Inodes Processed: 1"));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

verify only B is loaded, not A&C

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@JiamingMai JiamingMai force-pushed the add-regx-pattern-file-filter branch from 4e3efab to ad2ac8b Compare October 26, 2023 02:13
Copy link
Contributor

@jja725 jja725 left a comment

Choose a reason for hiding this comment

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

LGTM

@JiamingMai
Copy link
Contributor Author

alluxio-bot, merge this please

@alluxio-bot alluxio-bot merged commit d0ad98f into Alluxio:main Oct 26, 2023
@JiamingMai JiamingMai deleted the add-regx-pattern-file-filter branch November 20, 2023 10:34
ssz1997 pushed a commit to ssz1997/alluxio that referenced this pull request Dec 15, 2023
Add regx pattern file filter for distributed load.

**Example:**
The following request allows us to load the files under `/test-load` directory with "hello" prefix:
`curl -X GET http://localhost:28080/v1/load?path=s3a://jiamingmai-test/test-load&opType=submit&verbose=true&fileFilterRegx=^hello.*`
			pr-link: Alluxio#18311
			change-id: cid-4ec2bfe58bfba413f6d2925f5b3937bd6f5c2eb1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature This issue is a feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants