Skip to content

FLUME-3023 {variable} substitution doesn't work for property 'fileSuffix' #110

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

Open
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

bharatjiitd
Copy link

Escaped the suffix before passing it to bucket writer.

Copy link
Member

@bessbd bessbd left a comment

Choose a reason for hiding this comment

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

The new test seems to be passing without applying the changes to HDFSEventSink.java .

Can you please double-check the code?

String translatedSuffixString = BucketPath.escapeString(SUFFIX, e.getHeaders());

BucketWriter bucketWriter = new BucketWriter(
ROLL_INTERVAL, 0, 0, 0, ctx, "/tmp", "file", "", translatedSuffixString, null, null,
Copy link
Member

Choose a reason for hiding this comment

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

Isn't SUFFIX to be supplied here?

Copy link
Author

Choose a reason for hiding this comment

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

ignore this test I will write a new one ... this seems to be incorrect.

Copy link
Member

@bessbd bessbd left a comment

Choose a reason for hiding this comment

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

Can you please provide a minimal changeset? (Ie. remove all formatting and whitespace-only changes, in order to help with the review and have a clean patch.)


// check that the roll happened correctly for the given data
Assert.assertTrue("File suffix translation failed: " + fList[0].toUri(),
fList[0].getName().indexOf(translatedSuffixString) != -1);
Copy link
Member

Choose a reason for hiding this comment

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

This could be rewritten as fList[0].getName().contains(translatedSuffixString). Also, I think it should be fList[0].getName().endsWith(translatedSuffixString)

sink.stop();

String translatedSuffixString =
BucketPath.escapeString(context.getString("hdfs.fileSuffix"), event.getHeaders());
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we hard-code the value of translatedSuffixString? (I think it is always "_20170201.avro")

};
Clock prevClock = BucketPath.getClock();

BucketPath.setClock(testClock);
Copy link
Member

Choose a reason for hiding this comment

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

Is setting the clock necessary?

@asfgit
Copy link

asfgit commented Aug 17, 2018

Can one of the admins verify this patch?

waidr pushed a commit to waidr/flume that referenced this pull request Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants