本文整理汇总了Java中com.couchbase.client.java.cluster.DefaultBucketSettings类的典型用法代码示例。如果您正苦于以下问题:Java DefaultBucketSettings类的具体用法?Java DefaultBucketSettings怎么用?Java DefaultBucketSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultBucketSettings类属于com.couchbase.client.java.cluster包,在下文中一共展示了DefaultBucketSettings类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testSimple
import com.couchbase.client.java.cluster.DefaultBucketSettings; //导入依赖的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: init
import com.couchbase.client.java.cluster.DefaultBucketSettings; //导入依赖的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
示例3: init
import com.couchbase.client.java.cluster.DefaultBucketSettings; //导入依赖的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
示例4: givenCacheLoaderWith
import com.couchbase.client.java.cluster.DefaultBucketSettings; //导入依赖的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
示例5: getCouchbaseContainer
import com.couchbase.client.java.cluster.DefaultBucketSettings; //导入依赖的package包/类
private static CouchbaseContainer getCouchbaseContainer() {
if (couchbaseContainer != null) {
return couchbaseContainer;
}
couchbaseContainer = new CouchbaseContainer("<%= DOCKER_COUCHBASE %>")
.withNewBucket(DefaultBucketSettings.builder()
.name(name)
.type(BucketType.COUCHBASE)
.quota(100)
.build());
couchbaseContainer.start();
return couchbaseContainer;
}
开发者ID:jhipster,项目名称:generator-jhipster,代码行数:14,代码来源:_DatabaseTestConfiguration.java
示例6: parseParameters
import com.couchbase.client.java.cluster.DefaultBucketSettings; //导入依赖的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
示例7: init
import com.couchbase.client.java.cluster.DefaultBucketSettings; //导入依赖的package包/类
@BeforeClass
public static void init() {
//here is where you'd get the environment
cachingProvider = new CouchbaseCachingProvider();
//here is where we get the cluster
cacheManager = (CouchbaseCacheManager) cachingProvider.getCacheManager();
ClusterManager manager = cacheManager.cluster.clusterManager(CLUSTER_LOGIN, CLUSTER_PWD);
boolean hasBucket = manager.hasBucket(CACHE_NAME);
if (!hasBucket) {
manager.insertBucket(DefaultBucketSettings.builder()
.name(CACHE_NAME)
.enableFlush(true)
.quota(100)
.build());
}
//here we create a dedicated cache for most of the tests
CouchbaseConfiguration<String, String> cbConfig = new CouchbaseConfiguration.Builder<String, String>(
CACHE_NAME, KeyConverter.STRING_KEY_CONVERTER)
.useDedicatedBucket(CACHE_NAME, "")
.build();
dedicatedCache = (CouchbaseCache<String, String>) cacheManager.createCache(CACHE_NAME, cbConfig);
keyConverter = dedicatedCache.keyConverter();
//prepare data
if (hasBucket) {
dedicatedCache.bucket.bucketManager().flush();
}
dedicatedCache.bucket.insert(SerializableDocument.create(keyConverter.asString(TEST_KEY), TEST_VALUE));
dedicatedCache.bucket.insert(SerializableDocument.create(keyConverter.asString(TEST_KEY) + "2", TEST_VALUE + "2"));
dedicatedCache.bucket.insert(SerializableDocument.create(keyConverter.asString("remove"), TEST_VALUE));
dedicatedCache.bucket.insert(SerializableDocument.create(keyConverter.asString("oldremove"), TEST_VALUE));
dedicatedCache.bucket.insert(SerializableDocument.create(keyConverter.asString("getremove"), TEST_VALUE));
dedicatedCache.bucket.insert(SerializableDocument.create(keyConverter.asString("itremove"), TEST_VALUE));
dedicatedCache.bucket.insert(SerializableDocument.create(keyConverter.asString("replace"), TEST_VALUE));
dedicatedCache.bucket.insert(SerializableDocument.create(keyConverter.asString("oldreplace"), TEST_VALUE));
dedicatedCache.bucket.insert(SerializableDocument.create(keyConverter.asString("getreplace"), TEST_VALUE));
//TODO prepare view
}
开发者ID:couchbaselabs,项目名称:couchbase-java-cache,代码行数:42,代码来源:BasicOperationTest.java
注:本文中的com.couchbase.client.java.cluster.DefaultBucketSettings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论