当前位置: 首页>>代码示例>>Java>>正文


Java ClusterName类代码示例

本文整理汇总了Java中com.stratio.crossdata.common.data.ClusterName的典型用法代码示例。如果您正苦于以下问题:Java ClusterName类的具体用法?Java ClusterName怎么用?Java ClusterName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClusterName类属于com.stratio.crossdata.common.data包,在下文中一共展示了ClusterName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: retrieveConfiguration

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
/**
 * Creates a new query job configuration object from the generic one related to the cluster name.
 * 
 * @param clusterName
 *            Cluster name.
 * 
 * @return A new query job object containing the cluster configuration.
 * 
 * @throws ExecutionException
 *             If the execution of the required steps fails.
 */
private ExtractorConfig<Cells> retrieveConfiguration(ClusterName clusterName) throws ExecutionException {

	DeepConnection deepConnection = null;

	deepConnection = (DeepConnection) deepConnectionHandler.getConnection(clusterName.getName());


	ExtractorConfig<Cells> extractorConfig;
	if (deepConnection != null) {
		extractorConfig = deepConnection.getExtractorConfig().clone();
	} else {
		throw new ExecutionException("Unknown cluster [" + clusterName.toString() + "]");
	}

	return extractorConfig;
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:28,代码来源:QueryExecutor.java

示例2: testConnect

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
/**
 * Establish the connection with DeepSparkContext in order to be able to retrieve metadata from the system columns
 * with the connection config.
 * 
 * @param
 * @return Whether the connection has been established or not.
 */

@Test
public void testConnect() throws Exception {

    ICredentials iCredentials = mock(ICredentials.class);
    ClusterName clusterName = new ClusterName(CLUSTER_NAME);
    Map<String, String> options = new HashMap<>();
    ConnectorClusterConfig config = new ConnectorClusterConfig(clusterName, options, options);
    config.setDataStoreName(new DataStoreName(DATASTORE_NAME));

    DeepConnectionHandler connectionHandler = mock(DeepConnectionHandler.class);
    Whitebox.setInternalState(deepConnector, "connectionHandler", connectionHandler);

    deepConnector.connect(iCredentials, config);

    verify(connectionHandler, times(1)).createConnection(iCredentials, config);
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:25,代码来源:DeepContextConnectorTest.java

示例3: testClose

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
@Test
public void testClose() throws ConnectionException, ExecutionException {

    ICredentials iCredentials = mock(ICredentials.class);
    ClusterName clusterName = new ClusterName(CLUSTER_NAME);

    Map<String, String> options = new HashMap<>();
    ConnectorClusterConfig config = new ConnectorClusterConfig(clusterName, options, options);
    config.setDataStoreName(new DataStoreName(DATASTORE_NAME));
    DeepConnectionHandler connectionHandler = mock(DeepConnectionHandler.class);
    Whitebox.setInternalState(deepConnector, "connectionHandler", connectionHandler);

    deepConnector.connect(iCredentials, config);

    connectionHandler.closeConnection(clusterName.getName());

    DeepConnection conn = (DeepConnection) connectionHandler.getConnection(clusterName.getName());
    assertNull(conn);

}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:21,代码来源:DeepContextConnectorTest.java

示例4: insert

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的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());
}
 
开发者ID:aagea,项目名称:crossdata-connector-irc,代码行数:10,代码来源:IRCStorageEngine.java

示例5: createIndex

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的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");
    }
}
 
开发者ID:aagea,项目名称:crossdata-connector-irc,代码行数:11,代码来源:IRCMetadataEngine.java

示例6: createProject

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
public static Project createProject(String clusterName, String catalogName, String tableName,
                                    List<String> columnList) {

    List<ColumnName> columns = new ArrayList<>();
    for (String column : columnList) {
        columns.add(new ColumnName(catalogName, tableName, column));
    }

    TableName table = new TableName(catalogName, tableName);
    HashSet<Operations> operations = new HashSet<>();
    operations.add(Operations.PROJECT);

    return new Project(operations, table, new ClusterName(clusterName), columns);
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:15,代码来源:LogicalWorkflowBuilder.java

示例7: createProject

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
private Project createProject(ClusterName clusterName, TableName tableName) {

        List<ColumnName> columns = new ArrayList<>();
        columns.add(new ColumnName(CATALOG_CONSTANT, tableName.getName(), COLUMN1_CONSTANT));
        columns.add(new ColumnName(CATALOG_CONSTANT, tableName.getName(), COLUMN2_CONSTANT));

        Set<Operations> operations = new HashSet<>();
        operations.add(Operations.PROJECT);

        return new Project(operations, tableName, clusterName, columns);
    }
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:12,代码来源:QueryExecutorTest.java

示例8: testCreateConnection

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
/**
 * Method: createConnection(String clusterName, Connection connection)
 */
@Test
public void testCreateConnection() throws Exception {

    ICredentials credentials = mock(ICredentials.class);
    Map<String, String> options = new HashMap<>();
    options.put(ExtractorConstants.HOST, "127.0.0.1");
    options.put(ExtractorConstants.HOSTS, "127.0.0.1 , 127.0.0.2");
    options.put(ExtractorConstants.PORT, "PORT");
    options.put(DeepConnectorConstants.EXTRACTOR_IMPL_CLASS, "PORT");

    ConnectorClusterConfig config = new ConnectorClusterConfig(new ClusterName(CLUSTER_NAME), options, options);
    config.setDataStoreName(new DataStoreName("cassandra"));

    DeepConnection connection = mock(DeepConnection.class);
    whenNew(DeepConnection.class).withArguments(credentials, config).thenReturn(connection);

    connectionHandler.createConnection(credentials, config);

    Map<String, DeepConnection> mapConnection = (Map<String, DeepConnection>) Whitebox.getInternalState(
            connectionHandler, "connections");

    DeepConnection recoveredConnection = mapConnection.get(CLUSTER_NAME);

    assertNotNull("The connection is not null", recoveredConnection);
    // assertEquals("The recoveredConnection is correct", connection, recoveredConnection);
}
 
开发者ID:Stratio,项目名称:stratio-connector-deep,代码行数:30,代码来源:ConnectionHandlerTest.java

示例9: close

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
@Override public void close(ClusterName name) throws ConnectionException {
    LOG.info("Close connection " + name.toString());
    IRCManager manager=managers.get(name);
    manager.disconnect();
}
 
开发者ID:aagea,项目名称:crossdata-connector-irc,代码行数:6,代码来源:IRCConnector.java

示例10: isConnected

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
@Override public boolean isConnected(ClusterName name) {
    return managers.containsKey(name);
}
 
开发者ID:aagea,项目名称:crossdata-connector-irc,代码行数:4,代码来源:IRCConnector.java

示例11: IRCStorageEngine

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
public IRCStorageEngine(Map<ClusterName,IRCManager> managers){
    this.managers=managers;
}
 
开发者ID:aagea,项目名称:crossdata-connector-irc,代码行数:4,代码来源:IRCStorageEngine.java

示例12: delete

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
@Override public void delete(ClusterName targetCluster, TableName tableName, Collection<Filter> whereClauses)
        throws ConnectorException {
    throw new UnsupportedException("Method not implemented");
}
 
开发者ID:aagea,项目名称:crossdata-connector-irc,代码行数:5,代码来源:IRCStorageEngine.java

示例13: update

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
@Override public void update(ClusterName targetCluster, TableName tableName, Collection<Relation> assignments,
        Collection<Filter> whereClauses) throws ConnectorException {
    throw new UnsupportedException("Method not implemented");
}
 
开发者ID:aagea,项目名称:crossdata-connector-irc,代码行数:5,代码来源:IRCStorageEngine.java

示例14: truncate

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
@Override public void truncate(ClusterName targetCluster, TableName tableName) throws ConnectorException {
    throw new UnsupportedException("Method not implemented");
}
 
开发者ID:aagea,项目名称:crossdata-connector-irc,代码行数:4,代码来源:IRCStorageEngine.java

示例15: IRCMetadataEngine

import com.stratio.crossdata.common.data.ClusterName; //导入依赖的package包/类
public IRCMetadataEngine(Map<ClusterName,IRCManager> managers){
    this.managers = managers;
}
 
开发者ID:aagea,项目名称:crossdata-connector-irc,代码行数:4,代码来源:IRCMetadataEngine.java


注:本文中的com.stratio.crossdata.common.data.ClusterName类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。