Search in sources :

Example 1 with GetFeaturesSizeResponse

use of org.polymap.core.data.feature.GetFeaturesSizeResponse in project polymap4-core by Polymap4.

the class PipelineFeatureSource method getCountInternal.

@Override
@SuppressWarnings("hiding")
protected int getCountInternal(Query query) throws IOException {
    GetFeaturesSizeRequest request = new GetFeaturesSizeRequest(query);
    try {
        final int[] result = new int[1];
        newExecutor().execute(pipeline, request, (ProcessorResponse r) -> {
            GetFeaturesSizeResponse response = (GetFeaturesSizeResponse) r;
            result[0] = response.getSize();
        });
        return result[0];
    } catch (Exception e) {
        Throwables.propagateIfInstanceOf(e, IOException.class);
        throw Throwables.propagate(e);
    }
}
Also used : GetFeaturesSizeRequest(org.polymap.core.data.feature.GetFeaturesSizeRequest) ProcessorResponse(org.polymap.core.data.pipeline.ProcessorResponse) GetFeaturesSizeResponse(org.polymap.core.data.feature.GetFeaturesSizeResponse) IOException(java.io.IOException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 GetFeaturesSizeRequest (org.polymap.core.data.feature.GetFeaturesSizeRequest)1 GetFeaturesSizeResponse (org.polymap.core.data.feature.GetFeaturesSizeResponse)1 ProcessorResponse (org.polymap.core.data.pipeline.ProcessorResponse)1