Conversation
| "The number of threads on each tablet server available to retrieve" | ||
| + " summary data, that is not currently in cache, from RFiles."), | ||
| TSERV_LASTLOCATION_UPDATE_TIME("tserver.lastlocation.update.time", "1000000", PropertyType.COUNT, | ||
| "The time in between tservers update last lcoation of tablets."), |
| String address, ZooLock zooLock, TServerInstance lastLocation) { | ||
|
|
||
| TabletMutator tablet = context.getAmple().mutateTablet(extent); | ||
| if(dfv.getNumEntries() > 0) { |
There was a problem hiding this comment.
Why are we passing this in and checking its number of entries?
There was a problem hiding this comment.
That is what previous functions used and was just copied over. I wasn't sure about the intentions but I agree that it is not needed.
| @Override | ||
| public void run() { | ||
| //this was more for testing | ||
| sleepUninterruptibly(10, |
| try { | ||
| //a pause in the action. this was taken from major compactor above | ||
| sleepUninterruptibly(getConfiguration().getTimeInMillis(Property.TSERV_LASTLOCATION_UPDATE_DELAY), | ||
| TimeUnit.MILLISECONDS); |
There was a problem hiding this comment.
I don't like the idea of sleep uninterruptibly here. Does this not imply that the tserver cannot be stopped until this timer is complete?
There was a problem hiding this comment.
This was done in major compactor for "Time a tablet server will sleep between checking which tablets need compaction". Just a small delay so it does not check right away. It might not be necessary.
|
|
||
| } | ||
|
|
||
| public void updateLastLocation(){ |
There was a problem hiding this comment.
need method comments for updateLastLocation and needsLastUpdate
| } | ||
|
|
||
| public void updateLastLocation(){ | ||
| synchronized (timeLock) { |
There was a problem hiding this comment.
why synchronize on timeLock. That is used for controlling access to persistedTime.
There was a problem hiding this comment.
That was leftover past iterations of my testing. I suppose if I update perssitedTime inside updateLastLocation as you mentioned below it might be needed?
| //will keep looking for a better way to check if a tablet is old and needs to be updated or not. In the mean time, this seems to work and the property can be adjusted. | ||
| if (tabletTime.getAndUpdateTime() - t.tabletTime.getMetadataTime(persistedTime).getTime() >= tabletServer.getConfiguration().getCount(Property.TSERV_LASTLOCATION_UPDATE_TIME)) { | ||
| //updat persisted time, maybe not needed | ||
| persistedTime = tabletTime.getAndUpdateTime(); |
There was a problem hiding this comment.
I would think we would do this when we do the update, not when we are checking whether we are to update.
There was a problem hiding this comment.
Only did it here since I pass in the updated persistedTime to updateLastLocation. I suppose it could be moved and simplify the check function.
| TabletMutator tablet = context.getAmple().mutateTablet(extent); | ||
| if(dfv.getNumEntries() > 0) { | ||
| //these two lines might not be needed for updating the last location | ||
| tablet.putFile(path, dfv); |
There was a problem hiding this comment.
What files are we changing? We are only changing the last location for the tablet, not the files. The time thing however may be needed.
There was a problem hiding this comment.
I figured it wasn't needed but I did not want to break anything.
| synchronized (timeLock) { | ||
| Tablet t = tabletServer.getOnlineTablet(extent); | ||
| SortedMap<FileRef, DataFileValue> sm = t.getDatafiles(); | ||
| for (Map.Entry<FileRef, DataFileValue> m : sm.entrySet()) { |
There was a problem hiding this comment.
A for loop over the files does not seem right here. We only need to change the last location of the tablet once.
There was a problem hiding this comment.
This will be removed since I will not pass in dfv or fileref anymore.
|
|
||
| public void updateLastLocation(){ | ||
| //update persisted time, maybe not needed | ||
| //persistedTime = tabletTime.getAndUpdateTime(); |
There was a problem hiding this comment.
I think you need this update now such that the persisted time is current.
|
|
||
| Tablet tablet = entry.getValue(); | ||
| //unsure if synchronized block is needed or not | ||
| synchronized (tablet) { |
There was a problem hiding this comment.
since we are updating the time stuff, I think this is required.
Add last_loc_update Add comments made requested changes made further revisions made further revisions changes for testing changes for testing final changes Add method comments
b75868a to
3122c2d
Compare
…st_loc_test_update2
No description provided.