-
Notifications
You must be signed in to change notification settings - Fork 15.2k
MINOR: AbstractSegments should not swallow exceptions #21636
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,7 @@ | |
|
|
||
| public abstract class AbstractRocksDBWindowStoreTest extends AbstractWindowBytesStoreTest { | ||
|
|
||
| private static final String STORE_NAME = "rocksDB window store"; | ||
| private static final String STORE_NAME = "rocksDB-windowstore"; | ||
| private static final String METRICS_SCOPE = "test-state-id"; | ||
|
|
||
| private final KeyValueSegments segments = | ||
|
|
@@ -602,7 +602,7 @@ public void testRestore() throws Exception { | |
| windowStore.close(); | ||
|
|
||
| // remove local store image | ||
| Utils.delete(baseDir); | ||
| Utils.delete(new File(baseDir, STORE_NAME)); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We delete a directory "too high" in the hierarchy, and thus when we later try to create a segment we cannot, because the parent directory does not exist. |
||
|
|
||
| windowStore = buildWindowStore(RETENTION_PERIOD, | ||
| WINDOW_SIZE, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -305,7 +305,7 @@ public void shouldUpdateSegmentFileNameFromOldDateFormatToNewFormat() throws Exc | |
| for (int segmentId = 0; segmentId < NUM_SEGMENTS; ++segmentId) { | ||
| final File oldSegment = new File(storeDirectoryPath + File.separator + storeName + "-" + formatter.format(new Date(segmentId * segmentInterval))); | ||
| //noinspection ResultOfMethodCallIgnored | ||
| Files.createFile(oldSegment.toPath()); | ||
| Files.createDirectory(oldSegment.toPath()); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Segments are directories -- if we create it here as a file, we later fail trying to create it as directory (create dir passed if dir already exists) |
||
| } | ||
|
|
||
| segments.openExisting(context, -1L); | ||
|
|
@@ -327,7 +327,7 @@ public void shouldUpdateSegmentFileNameFromOldColonFormatToNewFormat() throws Ex | |
| for (int segmentId = 0; segmentId < NUM_SEGMENTS; ++segmentId) { | ||
| final File oldSegment = new File(storeDirectoryPath + File.separator + storeName + ":" + segmentId * (RETENTION_PERIOD / (NUM_SEGMENTS - 1))); | ||
| //noinspection ResultOfMethodCallIgnored | ||
| Files.createFile(oldSegment.toPath()); | ||
| Files.createDirectory(oldSegment.toPath()); | ||
| } | ||
|
|
||
| segments.openExisting(context, -1L); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related -- but avoiding spaces sound like a good idea