Changeset 6154 for SRUAggregator


Ignore:
Timestamp:
04/22/15 08:25:01 (9 years ago)
Author:
emanuel.dima@uni-tuebingen.de
Message:
  1. beta-40: fixed bug in build script; improved 'more results' behavior
Location:
SRUAggregator/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • SRUAggregator/trunk/aggregator.yml

    r6132 r6154  
    1414
    1515  SEARCH_MAX_CONCURRENT_REQUESTS_PER_ENDPOINT: 4
    16   SEARCH_MAX_CONCURRENT_REQUESTS_PER_SLOW_ENDPOINT: 2
     16  SEARCH_MAX_CONCURRENT_REQUESTS_PER_SLOW_ENDPOINT: 1
    1717  slowEndpoints:
    1818    - http://cqlservlet.mpi.nl/
    1919
    20   ENDPOINTS_SCAN_TIMEOUT_MS: 60000
     20  ENDPOINTS_SCAN_TIMEOUT_MS: 600000
    2121  ENDPOINTS_SEARCH_TIMEOUT_MS: 30000
    2222  EXECUTOR_SHUTDOWN_TIMEOUT_MS: 1000
  • SRUAggregator/trunk/aggregator_devel.yml

    r6132 r6154  
    1414
    1515  SEARCH_MAX_CONCURRENT_REQUESTS_PER_ENDPOINT: 4
    16   SEARCH_MAX_CONCURRENT_REQUESTS_PER_SLOW_ENDPOINT: 2
     16  SEARCH_MAX_CONCURRENT_REQUESTS_PER_SLOW_ENDPOINT: 1
    1717  slowEndpoints:
    1818    - http://cqlservlet.mpi.nl/
  • SRUAggregator/trunk/build.sh

    r6153 r6154  
    8080then
    8181        echo; echo "---- run devel"
    82         JAR=`find target -iname 'Aggregator2-*.jar'`
    83         echo java -cp src/main/resources:$JAR eu.clarin.sru.fcs.aggregator.app.Aggregator server aggregator_development.yml
    84         java -cp src/main/resources:$JAR eu.clarin.sru.fcs.aggregator.app.Aggregator server aggregator_development.yml
     82        JAR=`find target -iname 'aggregator-*.jar'`
     83        echo java -cp src/main/resources:$JAR eu.clarin.sru.fcs.aggregator.app.Aggregator server aggregator_devel.yml
     84        java -cp src/main/resources:$JAR eu.clarin.sru.fcs.aggregator.app.Aggregator server aggregator_devel.yml
    8585fi
    8686
     
    8888then
    8989        echo; echo "---- run production"
    90         JAR=`find target -iname 'Aggregator2-*.jar'`
     90        JAR=`find target -iname 'aggregator-*.jar'`
    9191        echo java -jar $JAR server aggregator.yml
    9292        java -jar $JAR server aggregator.yml
  • SRUAggregator/trunk/pom.xml

    r6153 r6154  
    88        <groupId>eu.clarin.sru.fcs</groupId>
    99        <artifactId>aggregator</artifactId>
    10         <version>2.0.0-beta-39</version>
     10        <version>2.0.0-beta-40</version>
    1111        <name>FCS Aggregator</name>
    1212
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/search/Result.java

    r6153 r6154  
    33import eu.clarin.sru.client.SRUDiagnostic;
    44import eu.clarin.sru.client.SRURecord;
    5 import eu.clarin.sru.client.SRUSearchRetrieveRequest;
    65import eu.clarin.sru.fcs.aggregator.scan.Corpus;
    76import eu.clarin.sru.client.SRUSearchRetrieveResponse;
     
    3736        private final Corpus corpus;
    3837        private AtomicBoolean inProgress = new AtomicBoolean(true);
    39         private AtomicInteger endpointReturnedRecords = new AtomicInteger();
     38        private AtomicInteger nextRecordPosition = new AtomicInteger(1);
    4039        private AtomicReference<JsonException> exception = new AtomicReference<JsonException>();
    4140        private List<Diagnostic> diagnostics = Collections.synchronizedList(new ArrayList<Diagnostic>());
     
    6968                        }
    7069                }
     70                if (response.getNextRecordPosition() > 0) {
     71                        nextRecordPosition.set(response.getNextRecordPosition());
     72                }
    7173        }
    7274
    7375        void addRecord(SRURecord record) {
    74 //              TODO(edima): use response.getNextRecordPosition()
    75                 endpointReturnedRecords.getAndIncrement();
     76                nextRecordPosition.incrementAndGet();
    7677                if (record.isRecordSchema(ClarinFCSRecordData.RECORD_SCHEMA)) {
    7778                        ClarinFCSRecordData rd = (ClarinFCSRecordData) record.getRecordData();
     
    144145        }
    145146
    146         public int getEndpointReturnedRecords() {
    147                 return endpointReturnedRecords.get();
     147        public int getNextRecordPosition() {
     148                return nextRecordPosition.get();
    148149        }
    149150
  • SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/search/Search.java

    r6153 r6154  
    6363                for (Result r : results) {
    6464                        if (r.getCorpus().getId().equals(corpusId)) {
    65                                 executeSearch(r, query, r.getEndpointReturnedRecords() + 1, maxRecords);
     65                                executeSearch(r, query, r.getNextRecordPosition(), maxRecords);
    6666                                return true;
    6767                        }
  • SRUAggregator/trunk/src/main/resources/assets/js/main.js

    r6153 r6154  
    33"use strict";
    44
    5 var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-38";
     5var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-40";
    66
    77var URLROOT = window.MyAggregator.URLROOT =
  • SRUAggregator/trunk/src/main/resources/assets/js/main.jsx

    r6153 r6154  
    33"use strict";
    44
    5 var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-39";
     5var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-40";
    66
    77var URLROOT = window.MyAggregator.URLROOT =
  • SRUAggregator/trunk/src/main/resources/assets/js/search.js

    r6153 r6154  
    763763                }
    764764                return  React.createElement("div", {className: "alert alert-warning", key: key},
    765                                         React.createElement("div", null, "Diagnostic: ", d.message)
     765                                        React.createElement("div", null, d.message)
    766766                                );
    767767        },
     
    878878        getInitialState: function() {
    879879                return {
    880                         inProgress: false,
     880                        forceUpdate: 1, // hack to force an update, used when searching for next results
    881881                };
    882882        },
    883883
    884         componentWillReceiveProps: function() {
    885                 this.setState({inProgress: false});
    886         },
    887 
    888884        nextResults: function(e) {
    889                 this.setState({inProgress: true});
     885                this.props.corpusHit.inProgress = true;
     886                this.setState({forceUpdate: this.state.forceUpdate+1});
    890887                this.props.nextResults(this.props.corpusHit.corpus.id);
    891888        },
     
    899896
    900897        renderMoreResults:function(){
    901                 if (this.state.inProgress || this.props.corpusHit.inProgress)
     898                if (this.props.corpusHit.inProgress)
    902899                        return React.createElement("span", {style: {fontStyle:'italic'}}, "Retrieving results, please wait...");
    903900
  • SRUAggregator/trunk/src/main/resources/assets/js/search.jsx

    r6153 r6154  
    763763                }
    764764                return  <div className="alert alert-warning" key={key}>
    765                                         <div>Diagnostic: {d.message}</div>
     765                                        <div>{d.message}</div>
    766766                                </div>;
    767767        },
     
    878878        getInitialState: function() {
    879879                return {
    880                         inProgress: false,
     880                        forceUpdate: 1, // hack to force an update, used when searching for next results
    881881                };
    882882        },
    883883
    884         componentWillReceiveProps: function() {
    885                 this.setState({inProgress: false});
    886         },
    887 
    888884        nextResults: function(e) {
    889                 this.setState({inProgress: true});
     885                this.props.corpusHit.inProgress = true;
     886                this.setState({forceUpdate: this.state.forceUpdate+1});
    890887                this.props.nextResults(this.props.corpusHit.corpus.id);
    891888        },
     
    899896
    900897        renderMoreResults:function(){
    901                 if (this.state.inProgress || this.props.corpusHit.inProgress)
     898                if (this.props.corpusHit.inProgress)
    902899                        return <span style={{fontStyle:'italic'}}>Retrieving results, please wait...</span>;
    903900
Note: See TracChangeset for help on using the changeset viewer.