mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-08 13:20:57 +00:00
Added stub for a processor query
This commit is contained in:
1 parent
a1c60f5134
commit
0fe488357d
2 files changed
+61
No files matched your search
+16
@@ -0,0 +1,16 @@
|
||||
package com.sap.sse.datamining.impl.components;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class TestQueryProcessor {
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void test() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.sap.sse.datamining.impl.components;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import com.sap.sse.datamining.Query;
|
||||
import com.sap.sse.datamining.components.Processor;
|
||||
import com.sap.sse.datamining.shared.GroupKey;
|
||||
import com.sap.sse.datamining.shared.QueryResult;
|
||||
|
||||
public class QueryProcessor<DataSourceType, AggregatedType> implements Query<AggregatedType>, Processor<Map<GroupKey, AggregatedType>> {
|
||||
|
||||
private final DataSourceType dataSource;
|
||||
private Processor<DataSourceType> firstProcessor;
|
||||
|
||||
private QueryResult<AggregatedType> result;
|
||||
|
||||
public QueryProcessor(DataSourceType dataSource) {
|
||||
this.dataSource = dataSource;
|
||||
}
|
||||
|
||||
public void setFirstProcessor(Processor<DataSourceType> firstProcessor) {
|
||||
this.firstProcessor = firstProcessor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryResult<AggregatedType> run() throws InterruptedException, ExecutionException {
|
||||
firstProcessor.onElement(dataSource);
|
||||
wait();
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onElement(Map<GroupKey, AggregatedType> element) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finish() throws InterruptedException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user