Skip to content

ACCUMULO-4074#510

Closed
bbux-atg wants to merge 2 commits intoapache:masterfrom
bbux-atg:ACCUMULO-4074
Closed

ACCUMULO-4074#510
bbux-atg wants to merge 2 commits intoapache:masterfrom
bbux-atg:ACCUMULO-4074

Conversation

@bbux-atg
Copy link
Copy Markdown
Contributor

@bbux-atg bbux-atg commented Jun 1, 2018

Depends on #509. Acting as a proxy for @ marco polo to port changes from custom fork. Currently fails to pass verify due to conflict between format and checkstyle plugin. Format plugin will unwrap multi line declaration which makes checkstyle complain about line being too long.

@ctubbsii ctubbsii changed the title Accumulo 4074 ACCUMULO-4074 Jun 1, 2018
@keith-turner keith-turner self-assigned this Jun 5, 2018
@keith-turner keith-turner mentioned this pull request Jun 9, 2018
keith-turner added a commit to keith-turner/accumulo that referenced this pull request Jul 3, 2018
 * Created plugin API for prioritizing scans that avoids accessing internal
   types.  This should make user written comparators more stable over time.
 * Made it possible to configure a comparator for each scan executor. Was
   previously a single comparator type for all executors.
 * Made it possible to pass options for comparator creation
 * Made it possible to configure a per table dispatcher. This dispatcher
   chooses which scan executor to use.  Dispatcher are user written plugins.
 * Fixed comparator type casting. I don't think the comparators in apache#510 worked
   because the Runnables were never the type expected. Also, abstracted all of
   this away from a user who may write a comparator.
keith-turner added a commit to keith-turner/accumulo that referenced this pull request Jul 3, 2018
 * Created plugin API for prioritizing scans that avoids accessing internal
   types.  This should make user written comparators more stable over time.
 * Made it possible to configure a comparator for each scan executor. Was
   previously a single comparator type for all executors.
 * Made it possible to pass options for comparator creation
 * Made it possible to configure a per table dispatcher. This dispatcher
   chooses which scan executor to use.  Dispatcher are user written plugins.
 * Fixed comparator type casting. I don't think the comparators in apache#510 worked
   because the Runnables were never the type expected. Also, abstracted all of
   this away from a user who may write a comparator.
Copy link
Copy Markdown
Contributor

@keith-turner keith-turner left a comment

Choose a reason for hiding this comment

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

I created #549 as a replacement for this PR.

public class DefaultSessionComparator extends SessionComparator {

@Override
public int compareSession(Session sessionA, Session sessionB) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I did not carry this forward in #549 for the following reasons :

  • Its goal is not documented and its hard to understand the goal looking at the code.
  • Its seems to prioritize newer scans with an exception for scans with "large" idle times. However, I think for two scans that have never run it should prioritize the oldest. But this goes back to the goal not being documented.
  • I think there may be overflow bugs with casting of long to int, but maybe this was intentional?? Not sure.

* we have to begin aging A
*/
if (idleTimeA > sessionA.maxIdleAccessTime) {
comparison = -1 * Long.valueOf(idleTimeA - maxIdle).intValue();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems that if we are here, then we know that

  • idleTimeA > sessionA.maxIdleAccessTime
  • sessionA.maxIdleAccessTime >= maxIdle

Therefore it seems that idleTimeA - maxIdle will always be positive, unless there is some expectation with casting long to int??

@bbux-atg
Copy link
Copy Markdown
Contributor Author

bbux-atg commented Jul 5, 2018

closing as the changes are updated in #549

@bbux-atg bbux-atg closed this Jul 5, 2018
keith-turner added a commit that referenced this pull request Jul 10, 2018
 * Created plugin API for prioritizing scans that avoids accessing internal
   types.  This should make user written comparators more stable over time.
 * Made it possible to configure a comparator for each scan executor. Was
   previously a single comparator type for all executors.
 * Made it possible to pass options for comparator creation
 * Made it possible to configure a per table dispatcher. This dispatcher
   chooses which scan executor to use.  Dispatcher are user written plugins.
 * Fixed comparator type casting. I don't think the comparators in #510 worked
   because the Runnables were never the type expected. Also, abstracted all of
   this away from a user who may write a comparator.
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.

2 participants