Github user afs commented on a diff in the pull request:

    https://github.com/apache/jena/pull/459#discussion_r209421919
  
    --- Diff: 
jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/server/DataService.java
 ---
    @@ -151,50 +151,24 @@ public long getRequestsBad() {
             return counters.value(CounterName.RequestsBad) ;
         }
     
    -    /** Counter of active read transactions */
    -    public AtomicLong   activeReadTxn           = new AtomicLong(0) ;
    +    /** Counter of active transactions */
    +    public AtomicLong   activeTxn           = new AtomicLong(0) ;
     
    -    /** Counter of active write transactions */
    -    public AtomicLong   activeWriteTxn          = new AtomicLong(0) ;
    +    /** Cumulative counter of transactions */
    +    public AtomicLong   totalTxn            = new AtomicLong(0) ;
     
    -    /** Cumulative counter of read transactions */
    -    public AtomicLong   totalReadTxn            = new AtomicLong(0) ;
    -
    -    /** Cumulative counter of writer transactions */
    -    public AtomicLong   totalWriteTxn           = new AtomicLong(0) ;
    -
    -    public void startTxn(ReadWrite mode)
    -    {
    -        switch(mode)
    -        {
    -            case READ:  
    -                activeReadTxn.getAndIncrement() ;
    -                totalReadTxn.getAndIncrement() ;
    -                break ;
    -            case WRITE:
    -                activeWriteTxn.getAndIncrement() ;
    -                totalWriteTxn.getAndIncrement() ;
    -                break ;
    -        }
    +    public void startTxn(TxnType mode) {
    +        activeTxn.getAndIncrement();
    +        totalTxn.getAndIncrement();
         }
     
    -    public void finishTxn(ReadWrite mode)
    --- End diff --
    
    Removed requestCounter and checkShutdown.
    
    (And renamed DatasetStatus as DataServiceStatus becaue it is a more 
accurate name).
    
    More generally, looking at this and clean up code in `ActionDatasets`, I 
think some rewriting is called for so see a commit to come for some better 
handling.


---

Reply via email to