Permalink
Browse files

support configurable number of vbuckets

defaults to 64 for Mac
and 1024 on all other platforms
  • Loading branch information...
1 parent adf0ae2 commit 9531986f60210a60fd8aa48d14da5d7d7b2f1b55 @mschoch mschoch committed Jan 2, 2013
@@ -65,6 +65,8 @@
private String checkpointDocumentType;
private String dynamicTypePath;
+ private final int numVbuckets;
+
@Inject
public CouchbaseCAPITransportImpl(Settings settings, RestController restController, NetworkService networkService, IndicesService indicesService, MetaDataMappingService metaDataMappingService, Client client) {
super(settings);
@@ -81,6 +83,14 @@ public CouchbaseCAPITransportImpl(Settings settings, RestController restControll
this.checkpointDocumentType = settings.get("couchbase.checkpointDocumentType", DEFAULT_DOCUMENT_TYPE_CHECKPOINT);
this.dynamicTypePath = settings.get("couchbase.dynamicTypePath");
this.resolveConflicts = settings.getAsBoolean("couchbase.resolveConflicts", true);
+
+ int defaultNumVbuckets = 1024;
+ if(System.getProperty("os.name").toLowerCase().contains("mac")) {
+ logger.info("Detected platform is Mac, changing default num_vbuckets to 64");
+ defaultNumVbuckets = 64;
+ }
+
+ this.numVbuckets = settings.getAsInt("couchbase.num_vbuckets", defaultNumVbuckets);
}
@Override
@@ -118,7 +128,8 @@ public boolean onPortNumber(int portNumber) {
server = new CAPIServer(capiBehavior, couchbaseBehavior,
new InetSocketAddress(hostAddress, portNumber),
CouchbaseCAPITransportImpl.this.username,
- CouchbaseCAPITransportImpl.this.password);
+ CouchbaseCAPITransportImpl.this.password,
+ numVbuckets);
if (publishAddressHost != null) {

0 comments on commit 9531986

Please sign in to comment.