You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/12/02 16:41:36 UTC

[GitHub] [accumulo] keith-turner commented on issue #1374: Give ThriftTransportPool higher concurrent granularity

keith-turner commented on issue #1374: Give ThriftTransportPool higher concurrent granularity
URL: https://github.com/apache/accumulo/pull/1374#issuecomment-560477230
 
 
   @lbschanno testing that single threaded functionality is correct would be nice.  Ideally mocking could be used in a unit test, so an IT is not needed.  Do you want to do that in a follow up PR?
   
   As for multi-threaded test, I think a simple test could be written.  Like have 10 threads all request connections and make sure they all get diff connections.  Could use a barrier (count down latch), where each thread does something like the following.
   
   ```java
      var conn  = getConnection(...)
      sharedList1.add(conn)
      latch1.countDown()
      latch1.await()
      returnConn(conn);
   
      conn  = getConnection(...)
      sharedList2.add(conn)
      latch2.countDown()
      latch2.await()
      returnConn(conn);
   ```
   
   in the main test method could do the following
   
   ```java
     // create the two countdown latches of size X
     // create the two shared list
     // create X threads each running the code above
     latch1.await()
     // verify there are X unique objects in sharedList1
     latch2.await()
     // verify there are X unique objects in sharedList2 
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services