Skip to content

Conversation

@SethSmucker
Copy link
Collaborator

fixes #3186
part of #2443

Copy link
Collaborator

@lbschanno lbschanno left a comment

Choose a reason for hiding this comment

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

Some additional usages of Object.finalize() that I found:

  • datawave.core.iterators.filesystem.FileSystemCache
  • datawave.core.iterators.querylock.ZookeeperQueryLock
  • datawave.core.iterators.querylock.HdfsQueryLock
  • datawave.query.planner.DefaultQueryPlanner

Both ZookeeperQueryLock and HdfsQueryLock, along with CombinedQueryLock, implement QueryLock. I don't think it would be unreasonable to have QueryLock implement Autocloseable, and make the various implementations implement close().

@Override
protected void finalize() throws Throwable {

protected void close() throws Throwable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be scoped public to be consistent with Autocloseable.

}

@Override
protected void finalize() throws Throwable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

FileIterator should probably also implement Autocloseable and call cleanup() in close().

@Override
protected void finalize() throws Throwable {
super.finalize();
public void close() throws IOException, InterruptedException {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be annotated with @Override and ShardTableQueryMetricHandler should implement Autocloseable.

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.

Replace deprecated Object.finalize()

3 participants