Skip to content

Comments

fix: concurrency issue causing file overwrite due to identical filenames#572

Merged
javeme merged 2 commits intomasterfrom
fix_zyxxoo
Feb 24, 2024
Merged

fix: concurrency issue causing file overwrite due to identical filenames#572
javeme merged 2 commits intomasterfrom
fix_zyxxoo

Conversation

@zyxxoo
Copy link
Contributor

@zyxxoo zyxxoo commented Jan 29, 2024

Purpose of the PR

  • close #xxx

Main Changes

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
    • xxx

Does this PR potentially affect the following parts?

  • Nope
  • Dependencies (add/update license info)
  • Modify configurations
  • The public API
  • Other affects (typed here)

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 29, 2024
@github-actions github-actions bot added the loader hugegraph-loader label Jan 29, 2024
Comment on lines +106 to +126
public static String fileID() {
long timeStamp = System.currentTimeMillis() / 1000;
ByteBuffer byteBuffer = ByteBuffer.allocate(12);

byteBuffer.put(int3((int) timeStamp));
byteBuffer.put(int2((int) timeStamp));
byteBuffer.put(int1((int) timeStamp));
byteBuffer.put(int0((int) timeStamp));

byteBuffer.put(int2(RANDOM_VALUE1));
byteBuffer.put(int1(RANDOM_VALUE1));
byteBuffer.put(int0(RANDOM_VALUE1));
byteBuffer.put(short1(RANDOM_VALUE2));
byteBuffer.put(short0(RANDOM_VALUE2));

byteBuffer.put(int2(NEXT_COUNTER.incrementAndGet()));
byteBuffer.put(int1(NEXT_COUNTER.incrementAndGet()));
byteBuffer.put(int0(NEXT_COUNTER.incrementAndGet()));

return Bytes.toHex(byteBuffer.array());
}
Copy link
Member

Choose a reason for hiding this comment

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

maybe we could leave/show a simple case for it? (hard to know the generated str now)

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 20, 2024
@javeme javeme merged commit b62c745 into master Feb 24, 2024
@javeme javeme deleted the fix_zyxxoo branch February 24, 2024 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer loader hugegraph-loader size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants