本文整理汇总了Java中com.couchbase.client.java.cluster.BucketSettings类的典型用法代码示例。如果您正苦于以下问题:Java BucketSettings类的具体用法?Java BucketSettings怎么用?Java BucketSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BucketSettings类属于com.couchbase.client.java.cluster包,在下文中一共展示了BucketSettings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testSimple
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
@Test
public void testSimple() throws Exception {
CouchbaseCluster cc = couchbase.geCouchbaseCluster();
ClusterManager cm = cc.clusterManager("Administrator","password");
List<BucketSettings> buckets = cm.getBuckets();
Assert.assertNotNull(buckets);
Assert.assertTrue(buckets.size() == 3);
BucketSettings settings = DefaultBucketSettings.builder()
.enableFlush(true).name("default").quota(100).replicas(0).type(BucketType.COUCHBASE).build();
settings = cm.insertBucket(settings);
CouchbaseWaitStrategy s = new CouchbaseWaitStrategy();
s.withBasicCredentials("Administrator", "password");
s.waitUntilReady(couchbase);
Bucket bucket = cc.openBucket("default");
Assert.assertNotNull(bucket);
}
开发者ID:ldoguin,项目名称:couchbase-test-docker,代码行数:17,代码来源:CouchbaseDriverTest.java
示例2: setup
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
@Setup
public void setup() {
// ClusterManager clusterManager = cluster.clusterManager("Administrator", "password");
// BucketSettings bucketSettings = new DefaultBucketSettings.Builder()
// .type(BucketType.COUCHBASE)
// .name(name)
// .replicas(0)
// .quota(120)
// .build();
//
// clusterManager.insertBucket(bucketSettings);
values = generateStrings(valueCount, minValueLength, maxValueLength);
ClusterManager clusterManager = cluster.clusterManager("Administrator", "password");
for (BucketSettings b : clusterManager.getBuckets()) {
logger.info(b);
}
bucket = cluster.openBucket(name);
}
开发者ID:hazelcast,项目名称:hazelcast-simulator,代码行数:22,代码来源:BucketReadWriteTest.java
示例3: init
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
@PostConstruct
public void init() throws Exception {
BucketSettings settings = DefaultBucketSettings.builder()
.enableFlush(true).name("default").quota(100).replicas(0).type(BucketType.COUCHBASE).build();
settings = couchbaseCluster().clusterManager(clusterUser, clusterPassword).insertBucket(settings);
couchbaseContainer.callCouchbaseRestAPI("/settings/indexes", "indexerThreads=0&logLevel=info&maxRollbackPoints=5&storageMode=memory_optimized", "Administrator", "password");
waitForContainer();
}
开发者ID:couchbaselabs,项目名称:GitTalent,代码行数:9,代码来源:CouchbaseTestConfig.java
示例4: createBucket
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
public void createBucket(BucketSettings bucketSetting, Boolean createIndex){
BucketSettings bucketSettings = getCouchbaseCluster().clusterManager(clusterUsername, clusterPassword).insertBucket(bucketSetting);
// allow some time for the query service to come up
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
if (createIndex) {
getCouchbaseCluster().openBucket().query(Index.createPrimaryIndex().on(bucketSetting.name()));
}
}
开发者ID:couchbaselabs,项目名称:GitTalent,代码行数:13,代码来源:CouchbaseContainer.java
示例5: start
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
@Override
public void start() {
super.start();
if (!newBuckets.isEmpty()) {
for (BucketSettings bucketSetting : newBuckets) {
createBucket(bucketSetting, index);
}
}
}
开发者ID:couchbaselabs,项目名称:GitTalent,代码行数:10,代码来源:CouchbaseContainer.java
示例6: init
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
@PostConstruct
public void init() throws Exception {
couchbaseContainer = AbstractSpringBootTestConfig.couchbaseContainer;
BucketSettings settings = DefaultBucketSettings.builder()
.enableFlush(true).name("default").quota(100).replicas(0).type(BucketType.COUCHBASE).build();
ClusterManager clusterManager = couchbaseContainer.geCouchbaseCluster().clusterManager(AbstractSpringBootTestConfig.clusterUser, AbstractSpringBootTestConfig.clusterPassword);
if (!clusterManager.hasBucket("default")){
settings = clusterManager.insertBucket(settings);
waitForContainer();
}
}
开发者ID:ldoguin,项目名称:testcontainers-spring-boot-couchbase,代码行数:13,代码来源:CouchbaseConfiguration.java
示例7: eval
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
@Override
public Sequence eval(final Sequence[] args, final Sequence contextSequence) throws XPathException {
// Get connection details
final String clusterId = args[0].itemAt(0).getStringValue();
CouchbaseClusterManager.getInstance().validate(clusterId);
// Get additional parameters
final String bucketName = (args[1].isEmpty()) ? Constants.DEFAULT_BUCKET : args[1].itemAt(0).getStringValue();
final String username = args[2].itemAt(0).getStringValue();
final String password = args[3].itemAt(0).getStringValue();
final Map<String, Object> parameters = (args[4].isEmpty())
? new HashMap<>()
: ConversionTools.convert((AbstractMapType) args[4].itemAt(0));
try {
// Get reference to cluster manager
final ClusterManager clusterManager = CouchbaseClusterManager.getInstance().get(clusterId).clusterManager(username, password);
// Get configuaration
final BucketSettings bucketSettings = parseParameters(bucketName, parameters);
// Execute
final BucketSettings insertBucket = clusterManager.insertBucket(bucketSettings);
// Return results
return new StringValue(insertBucket.toString());
} catch (final Throwable ex) {
return GenericExceptionHandler.handleException(this, ex);
}
}
开发者ID:weXsol,项目名称:Couchbase,代码行数:34,代码来源:InsertBucket.java
示例8: eval
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
@Override
public Sequence eval(final Sequence[] args, final Sequence contextSequence) throws XPathException {
// Get connection details
final String clusterId = args[0].itemAt(0).getStringValue();
CouchbaseClusterManager.getInstance().validate(clusterId);
// Get additional parameters
final String username = args[1].itemAt(0).getStringValue();
final String password = args[2].itemAt(0).getStringValue();
try {
// Get reference to cluster manager
final ClusterManager clusterManager = CouchbaseClusterManager.getInstance().get(clusterId).clusterManager(username, password);
// Execute
final List<BucketSettings> buckets = clusterManager.getBuckets();
final Sequence retVal = new ValueSequence();
for (final BucketSettings settings : buckets) {
retVal.add(new StringValue(settings.name()));
}
// Return results
return retVal;
} catch (final Throwable ex) {
return GenericExceptionHandler.handleException(this, ex);
}
}
开发者ID:weXsol,项目名称:Couchbase,代码行数:33,代码来源:ListBuckets.java
示例9: AbstractCouchbaseCacheLoader
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
/**
* @param bucketSettings Bucket that will hold cached objects.
* @param connectionContext Cluster connection.
* @param adminUser Administration user for Couchbase cluster.
* @param adminPassword Password for Administration user for Couchbase cluster.
* @param schemaOptions Determine whether to create/drop bucket.
*/
public AbstractCouchbaseCacheLoader(BucketSettings bucketSettings,
CouchbaseConnectionContext connectionContext, String adminUser,
String adminPassword, SchemaOptions schemaOptions) {
this.bucketSettings = bucketSettings;
this.connectionContext = connectionContext;
this.adminUser = adminUser;
this.adminPassword = adminPassword;
this.schemaOptions = schemaOptions;
}
开发者ID:Excelian,项目名称:Mache,代码行数:17,代码来源:AbstractCouchbaseCacheLoader.java
示例10: CouchbaseJsonProvisioner
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
/**
* Constructor.
*
* @param connectionContext - centrally managed resources
* @param bucketSettings - the couchbase bucket to use to store the data
* @param adminUser - admin username
* @param adminPassword - admin password
* @param schemaOptions - the schema policy
*/
protected CouchbaseJsonProvisioner(CouchbaseConnectionContext connectionContext,
BucketSettings bucketSettings,
String adminUser, String adminPassword,
SchemaOptions schemaOptions) {
this.connectionContext = connectionContext;
this.bucketSettings = bucketSettings;
this.adminUser = adminUser;
this.adminPassword = adminPassword;
this.schemaOptions = schemaOptions;
}
开发者ID:Excelian,项目名称:Mache,代码行数:20,代码来源:CouchbaseJsonProvisioner.java
示例11: CouchbaseProvisioner
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
protected CouchbaseProvisioner(CouchbaseConnectionContext couchbaseConnectionContext,
BucketSettings bucketSettings,
String adminUser, String adminPassword,
SchemaOptions schemaOptions) {
this.connectionContext = couchbaseConnectionContext;
this.bucketSettings = bucketSettings;
this.adminUser = adminUser;
this.adminPassword = adminPassword;
this.schemaOptions = schemaOptions;
}
开发者ID:Excelian,项目名称:Mache,代码行数:11,代码来源:CouchbaseProvisioner.java
示例12: givenCacheLoaderWith
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
private void givenCacheLoaderWith(SchemaOptions schemaOptions) {
final DefaultCouchbaseEnvironment nullEnvironmentAsSingletonWillBeHandledByTheContext = null;
final CouchbaseConnectionContext couchbaseConnectionContext =
CouchbaseConnectionContext.getInstance(nullEnvironmentAsSingletonWillBeHandledByTheContext,
singletonList("localhost"));
final BucketSettings bucket = DefaultBucketSettings.builder().name("test").build();
loader = new CouchbaseCacheLoader<>(Object.class,
bucket, couchbaseConnectionContext, "Admin", "Pass", schemaOptions);
}
开发者ID:Excelian,项目名称:Mache,代码行数:10,代码来源:CouchbaseCacheLoaderMockedTest.java
示例13: withNewBucket
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
public SELF withNewBucket(BucketSettings bucketSettings) {
newBuckets.add(bucketSettings);
return self();
}
开发者ID:couchbaselabs,项目名称:GitTalent,代码行数:5,代码来源:CouchbaseContainer.java
示例14: parseParameters
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
private BucketSettings parseParameters(final String bucketName, final Map<String, Object> parameters) throws XPathException {
final Builder builder = DefaultBucketSettings.builder().name(bucketName);
for (final Entry<String, Object> entry : parameters.entrySet()) {
final String key = entry.getKey();
final Object value = entry.getValue(); // check for empty sequence?
switch (key) {
case "enableFlush":
builder.enableFlush(ConversionTools.getBooleanValue(key, value, false));
break;
case "indexReplicas":
builder.indexReplicas(ConversionTools.getBooleanValue(key, value, false));
break;
case "password":
builder.password(value.toString());
break;
case "port":
builder.port(ConversionTools.getIntegerValue(key, value, 0));
break;
case "quota":
builder.quota(ConversionTools.getIntegerValue(key, value, 0));
break;
case "replicas":
builder.replicas(ConversionTools.getIntegerValue(key, value, 0));
break;
case "type":
builder.type(BucketType.valueOf(value.toString().toUpperCase(Locale.US)));
break;
default:
throw new IllegalArgumentException(String.format("'%s' is not a valid parameter.", key));
}
}
return builder;
}
开发者ID:weXsol,项目名称:Couchbase,代码行数:42,代码来源:InsertBucket.java
示例15: bucketsSettings
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
public Config bucketsSettings(BucketSettings... buckets) {
this.bucketsSettings = Arrays.asList(buckets);
return this;
}
开发者ID:ylemoigne,项目名称:ratpack-couchbase,代码行数:5,代码来源:CouchbaseModule.java
示例16: getBucketsSettings
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
public List<BucketSettings> getBucketsSettings() {
return bucketsSettings;
}
开发者ID:ylemoigne,项目名称:ratpack-couchbase,代码行数:4,代码来源:CouchbaseModule.java
示例17: create
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
default BucketInfo create(BucketSettings settings) {
return new DefaultBucketInfo(settings.name(), settings.password());
}
开发者ID:ylemoigne,项目名称:ratpack-couchbase,代码行数:4,代码来源:BucketInfo.java
示例18: CouchbaseProvisionerBuilder
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
/**
* @param bucketSettings the mandatory bucket settings.
*/
public CouchbaseProvisionerBuilder(BucketSettings bucketSettings) {
this.bucketSettings = bucketSettings;
}
开发者ID:Excelian,项目名称:Mache,代码行数:7,代码来源:CouchbaseProvisioner.java
示例19: thenBucketCreated
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
private void thenBucketCreated() {
verify(mockedManager).insertBucket(any(BucketSettings.class));
}
开发者ID:Excelian,项目名称:Mache,代码行数:4,代码来源:CouchbaseCacheLoaderMockedTest.java
示例20: CouchbaseCacheLoader
import com.couchbase.client.java.cluster.BucketSettings; //导入依赖的package包/类
/**
* @param valueType The class type of the cache value.
* @param bucketSettings Bucket that will hold cached objects.
* @param connectionContext Cluster connection.
* @param adminUser Administration user for Couchbase cluster.
* @param adminPassword Password for Administration user for Couchbase cluster.
* @param schemaOptions Determine whether to create/drop bucket.
*/
public CouchbaseCacheLoader(Class<V> valueType, BucketSettings bucketSettings,
CouchbaseConnectionContext connectionContext, String adminUser,
String adminPassword, SchemaOptions schemaOptions) {
super(bucketSettings, connectionContext, adminUser, adminPassword, schemaOptions);
this.valueType = valueType;
}
开发者ID:Excelian,项目名称:Mache,代码行数:15,代码来源:CouchbaseCacheLoader.java
注:本文中的com.couchbase.client.java.cluster.BucketSettings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论