本文整理汇总了Java中org.apache.kudu.client.ExternalConsistencyMode类的典型用法代码示例。如果您正苦于以下问题:Java ExternalConsistencyMode类的具体用法?Java ExternalConsistencyMode怎么用?Java ExternalConsistencyMode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExternalConsistencyMode类属于org.apache.kudu.client包,在下文中一共展示了ExternalConsistencyMode类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initKuduConfig
import org.apache.kudu.client.ExternalConsistencyMode; //导入依赖的package包/类
/***
* A simple init of the kudu connection config. Override this if you would like to fine tune hte connection parameters
* @param kuduTableName The Kudu table name
* @param kuduMasters The master hosts of the Kudu cluster.
*/
public void initKuduConfig(String kuduTableName, List<String> kuduMasters)
{
apexKuduConnectionBuilder = new ApexKuduConnection.ApexKuduConnectionBuilder()
.withTableName(kuduTableName)
.withExternalConsistencyMode(ExternalConsistencyMode.COMMIT_WAIT)
.withFlushMode(SessionConfiguration.FlushMode.AUTO_FLUSH_SYNC)
.withNumberOfBossThreads(1)
.withNumberOfWorkerThreads(2)
.withSocketReadTimeOutAs(3000)
.withOperationTimeOutAs(3000);
for ( String aMasterAndHost: kuduMasters ) {
apexKuduConnectionBuilder = apexKuduConnectionBuilder.withAPossibleMasterHostAs(aMasterAndHost);
}
apexKuduConnectionInfo = apexKuduConnectionBuilder;
}
示例2: openKuduSession
import org.apache.kudu.client.ExternalConsistencyMode; //导入依赖的package包/类
private KuduSession openKuduSession(List<ConfigIssue> issues) {
KuduSession session = kuduClient.newSession();
try {
session.setExternalConsistencyMode(ExternalConsistencyMode.valueOf(configBean.consistencyMode.name()));
} catch (IllegalArgumentException ex) {
issues.add(
getContext().createConfigIssue(
Groups.KUDU.name(),
KuduConfigBean.CONF_PREFIX + CONSISTENCY_MODE,
Errors.KUDU_02
)
);
}
session.setMutationBufferSpace(configBean.mutationBufferSpace);
session.setFlushMode(SessionConfiguration.FlushMode.MANUAL_FLUSH);
return session;
}
示例3: initKuduConfig
import org.apache.kudu.client.ExternalConsistencyMode; //导入依赖的package包/类
private void initKuduConfig(String kuduTableName, List<String> kuduMasters)
{
apexKuduConnectionBuilder = new ApexKuduConnection.ApexKuduConnectionBuilder()
.withTableName(kuduTableName)
.withExternalConsistencyMode(ExternalConsistencyMode.COMMIT_WAIT)
.withFlushMode(SessionConfiguration.FlushMode.AUTO_FLUSH_SYNC)
.withNumberOfBossThreads(1)
.withNumberOfWorkerThreads(2)
.withSocketReadTimeOutAs(3000)
.withOperationTimeOutAs(3000);
for ( String aMasterAndHost: kuduMasters ) {
apexKuduConnectionBuilder = apexKuduConnectionBuilder.withAPossibleMasterHostAs(aMasterAndHost);
}
}
示例4: getKuduConnectionConfig
import org.apache.kudu.client.ExternalConsistencyMode; //导入依赖的package包/类
@Override
ApexKuduConnection.ApexKuduConnectionBuilder getKuduConnectionConfig()
{
return new ApexKuduConnection.ApexKuduConnectionBuilder()
.withAPossibleMasterHostAs(KuduClientTestCommons.kuduMasterAddresses)
.withTableName(KuduClientTestCommons.tableName)
.withExternalConsistencyMode(ExternalConsistencyMode.COMMIT_WAIT)
.withFlushMode(SessionConfiguration.FlushMode.AUTO_FLUSH_SYNC)
.withNumberOfBossThreads(1)
.withNumberOfWorkerThreads(2)
.withSocketReadTimeOutAs(3000)
.withOperationTimeOutAs(3000);
}
示例5: setExternalConsistencyMode
import org.apache.kudu.client.ExternalConsistencyMode; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void setExternalConsistencyMode(ExternalConsistencyMode consistencyMode) {
session.setExternalConsistencyMode(consistencyMode);
}
示例6: getExternalConsistencyMode
import org.apache.kudu.client.ExternalConsistencyMode; //导入依赖的package包/类
public ExternalConsistencyMode getExternalConsistencyMode()
{
return externalConsistencyMode;
}
示例7: setExternalConsistencyMode
import org.apache.kudu.client.ExternalConsistencyMode; //导入依赖的package包/类
public void setExternalConsistencyMode(ExternalConsistencyMode externalConsistencyMode)
{
this.externalConsistencyMode = externalConsistencyMode;
}
示例8: withExternalConsistencyMode
import org.apache.kudu.client.ExternalConsistencyMode; //导入依赖的package包/类
public ApexKuduConnectionBuilder withExternalConsistencyMode(ExternalConsistencyMode externalConsistencyMode)
{
this.externalConsistencyMode = externalConsistencyMode;
isExternalConsistencyModeSet = true;
return this;
}