本文整理汇总了Java中com.stratio.crossdata.common.exceptions.ConnectorException类的典型用法代码示例。如果您正苦于以下问题:Java ConnectorException类的具体用法?Java ConnectorException怎么用?Java ConnectorException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConnectorException类属于com.stratio.crossdata.common.exceptions包,在下文中一共展示了ConnectorException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override
public QueryResult execute(LogicalWorkflow workflow) throws ConnectorException {
ResultSet resultSet = new ResultSet();
Project project = (Project) workflow.getInitialSteps().iterator().next();
IRCManager engine = managers.get(project.getClusterName());
List<Message> messages = engine.getMessagesFromChannel(project.getTableName().getName());
LogicalStep nextStep = project.getNextStep();
while (nextStep != null) {
if (nextStep instanceof Filter) {
Filter filter = (Filter) nextStep;
messages = this.applyFilter(messages, filter);
} else if (nextStep instanceof Select) {
Select select = (Select) nextStep;
resultSet = computeResultSet(messages, select);
}
nextStep = nextStep.getNextStep();
}
return QueryResult.createQueryResult(resultSet);
}
示例2: insert
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override public void insert(ClusterName targetCluster, TableMetadata targetTable, Row row)
throws ConnectorException {
Object message= row.getCell("message");
if(message==null){
throw new ConnectorException("You must add message column in the insert clause.");
}
IRCManager manager= managers.get(targetCluster);
manager.sendMessage(targetTable.getName().getName(),message.toString());
}
示例3: createIndex
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override
public void createIndex(ClusterName targetCluster, IndexMetadata indexMetadata)
throws ConnectorException {
if(indexMetadata.getColumns().size()>1){
throw new ConnectorException("Only supported one column index");
}
if(!indexMetadata.getColumns().containsKey("message")){
throw new ConnectorException("Only supported index in the column message");
}
}
示例4: twoProjectsJoinedAndSelectWithGroupByTest
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Test
public void twoProjectsJoinedAndSelectWithGroupByTest() throws ConnectorException {
// Input data
List<LogicalStep> stepList = new LinkedList<>();
Project projectLeft = createProject(CASSANDRA_CLUSTERNAME_CONSTANT, KEYSPACE, MYTABLE1_CONSTANT,
Arrays.asList(ARTIST_CONSTANT, DESCRIPTION_CONSTANT, TITLE_CONSTANT, YEAR_CONSTANT));
Project projectRight = createProject(CASSANDRA_CLUSTERNAME_CONSTANT, KEYSPACE, MYTABLE2_CONSTANT,
Arrays.asList(ARTIST_CONSTANT, AGE_CONSTANT));
Join join = createJoin("joinId", createColumn(KEYSPACE, MYTABLE1_CONSTANT, ARTIST_CONSTANT),
createColumn(KEYSPACE, MYTABLE2_CONSTANT, ARTIST_CONSTANT));
GroupBy groupBy = createGroupBy(Arrays.asList(createColumn(KEYSPACE, MYTABLE1_CONSTANT, ARTIST_CONSTANT)));
groupBy.setNextStep(createSelect(Arrays.asList(createColumn(KEYSPACE, MYTABLE1_CONSTANT, ARTIST_CONSTANT)),
Arrays.asList(ARTIST_ALIAS_CONSTANT)));
projectLeft.setNextStep(join);
projectRight.setNextStep(join);
join.setNextStep(groupBy);
// Two initial steps
stepList.add(projectLeft);
stepList.add(projectRight);
LogicalWorkflow logicalWorkflow = new LogicalWorkflow(stepList);
// Execution
QueryResult result = deepQueryEngine.execute(logicalWorkflow);
// Assertions
List<ColumnMetadata> columnsMetadata = result.getResultSet().getColumnMetadata();
List<Row> rowsList = result.getResultSet().getRows();
// Checking results number
assertEquals("Wrong number of rows metadata", 1, columnsMetadata.size());
assertEquals("Wrong number of rows", 36, rowsList.size());
// Checking metadata
assertEquals("Author expected", ARTIST_ALIAS_CONSTANT, columnsMetadata.get(0).getName().getAlias());
assertEquals("mytable1 expected", KEYSPACE + "." + MYTABLE1_CONSTANT, columnsMetadata.get(0).getName()
.getTableName().getQualifiedName());
// Checking rows
for (Row row : rowsList) {
assertEquals("Wrong number of columns in the row", 1, row.size());
assertNotNull("Expecting author column in row", row.getCell(ARTIST_ALIAS_CONSTANT));
}
}
示例5: delete
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override public void delete(ClusterName targetCluster, TableName tableName, Collection<Filter> whereClauses)
throws ConnectorException {
throw new UnsupportedException("Method not implemented");
}
示例6: update
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override public void update(ClusterName targetCluster, TableName tableName, Collection<Relation> assignments,
Collection<Filter> whereClauses) throws ConnectorException {
throw new UnsupportedException("Method not implemented");
}
示例7: truncate
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override public void truncate(ClusterName targetCluster, TableName tableName) throws ConnectorException {
throw new UnsupportedException("Method not implemented");
}
示例8: createCatalog
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override
public void createCatalog(ClusterName targetCluster, CatalogMetadata catalogMetadata)
throws ConnectorException {
throw new UnsupportedException("Method not implemented");
}
示例9: createTable
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override
public void createTable(ClusterName targetCluster, TableMetadata tableMetadata)
throws ConnectorException {
IRCManager manager = managers.get(targetCluster);
manager.joinChannel(tableMetadata.getName().getName());
}
示例10: dropCatalog
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override
public void dropCatalog(ClusterName targetCluster, CatalogName name) throws ConnectorException {
throw new UnsupportedException("Method not implemented");
}
示例11: alterTable
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override
public void alterTable(ClusterName targetCluster, TableName name, AlterOptions alterOptions)
throws ConnectorException {
throw new UnsupportedException("Method not implemented");
}
示例12: asyncExecute
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override
public void asyncExecute(String queryId, LogicalWorkflow workflow, IResultHandler resultHandler)
throws ConnectorException {
throw new UnsupportedException("Method not implemented");
}
示例13: stop
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override
public void stop(String queryId) throws ConnectorException {
throw new UnsupportedException("Method not implemented");
}
示例14: execute
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override public QueryResult execute(String queryId, LogicalWorkflow workflow) throws ConnectorException {
throw new UnsupportedException("Method not implemented");
}
示例15: pagedExecute
import com.stratio.crossdata.common.exceptions.ConnectorException; //导入依赖的package包/类
@Override public void pagedExecute(String queryId, LogicalWorkflow workflow, IResultHandler resultHandler,
int pageSize) throws ConnectorException {
throw new UnsupportedException("Method not implemented");
}