-
Notifications
You must be signed in to change notification settings - Fork 0
CASSANDRA-16926 #6
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
base: 16925-trunk
Are you sure you want to change the base?
Conversation
Co-authored-by: Benedict Elliott Smith <[email protected]> Co-authored-by: Aleksey Yeschenko <[email protected]>
|
||
public Map<String, TableSnapshot> listSnapshots() | ||
{ | ||
//<<<<<<< HEAD |
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.
nit: a leftover from rebasing I gues
return file.getParent() + File.pathSeparator() + ".." + File.pathSeparator() + file.getParentFile().getName() + File.pathSeparator() + file.getName(); | ||
} | ||
|
||
private void testEquivalence(String path) throws IOException |
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.
nit: too many spaces
@@ -139,12 +139,12 @@ public static long getRolesReadCount() | |||
return rolesTable.metric.readLatency.latency.getCount(); | |||
} | |||
|
|||
public static RoleOptions getLoginRoleOprions() | |||
public static RoleOptions getLoginRoleOptions() |
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.
It is been fixed in apache#1179, JFYI.
private static final Logger logger = LoggerFactory.getLogger(PathUtils.class); | ||
private static final NoSpamLogger nospam1m = NoSpamLogger.getLogger(logger, 1, TimeUnit.MINUTES); | ||
|
||
private static Consumer<Path> onDeletion = path -> { |
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.
Should we somehow take care about thread safety for onDeletion
?
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.
That’s best left to the Consumer implementation
Runtime.getRuntime().addShutdownHook(new Thread(this)); | ||
isRegistered = true; | ||
} | ||
logger.trace("Scheduling deferred {}deletion of file: {}", recursive ? "recursive " : "", path); |
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.
nit: missing space
/** | ||
* Wrapper around an InputStream that provides no buffering but can decode varints | ||
* | ||
* TODO: probably shouldn't use DataInputStream as a parent |
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.
can you elaborate a bit in the javadoc?
* | ||
* TODO codebase probably should not use tryList, as unexpected exceptions are hidden; | ||
* probably want to introduce e.g. listIfExists | ||
* TODO codebase probably should not use Paths.get() to ensure we can override the filesystem |
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.
Depending on how multi-filesystem is implemented, Paths.get(URI)
may still be usable. eg. URI scheme
represents different file system provider
, URI user info
represents tenant
or file type
(commitlog, or sstable) which maybe stored in different locations.
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.
Paths.get(URI)
is fine, but Paths.get(String)
unfortunately isn't, at least not universally. I'll update the TODO to distinguish.
*/ | ||
public File(String path) | ||
{ | ||
this(path.isEmpty() ? null : filesystem.getPath(path)); |
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 required for this patch, just sharing some ideas. Different path
may have different file systems, eg. commitlog maybe stored locally but sstable will be stored remotely; Or each keyspace may have its own FS.
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.
We could definitely support multiple file systems, but to do so across the codebase would require phasing out the use of this String
constructor, since the paths supplied to java.io.File
are plain paths referring to the default file system. I would definitely support this in a future patch, and hopefully this work has made that more manageable.
No description provided.