accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From keith-turner <...@git.apache.org>
Subject [GitHub] accumulo pull request: ACCUMULO-3509: Allow cleanup state to be ke...
Date Mon, 04 Jan 2016 16:37:43 GMT
Github user keith-turner commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/60#discussion_r48749879
  
    --- Diff: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Scanner.java
---
    @@ -38,100 +40,126 @@
       private ScanDataSource isolatedDataSource;
       private boolean sawException = false;
       private boolean scanClosed = false;
    +  protected Semaphore scannerSemaphore;
     
       Scanner(Tablet tablet, Range range, ScanOptions options) {
         this.tablet = tablet;
         this.range = range;
         this.options = options;
    +    scannerSemaphore = new Semaphore(1, true);
       }
     
    -  public synchronized ScanBatch read() throws IOException, TabletClosedException {
    -
    -    if (sawException)
    -      throw new IllegalStateException("Tried to use scanner after exception occurred.");
    +  public ScanBatch read() throws IOException, TabletClosedException {
     
         if (scanClosed)
    --- End diff --
    
    Below is from the semaphore javadoc.   Reading that is sounds like there is no guarantee
of seeing a change to `scanClosed` until after `acquire()`.
    
    ```
    Memory consistency effects: Actions in a thread prior to calling a "release" method such
as release() happen-before actions following a successful "acquire" method such as acquire()
in another thread.
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message