2929import com .mongodb .operation .OperationHelper .CallableWithConnection ;
3030import org .bson .BsonBoolean ;
3131import org .bson .BsonDocument ;
32+ import org .bson .BsonInt32 ;
3233import org .bson .BsonString ;
3334
3435import static com .mongodb .assertions .Assertions .notNull ;
3738import static com .mongodb .operation .CommandOperationHelper .executeWrappedCommandProtocolAsync ;
3839import static com .mongodb .operation .DocumentHelper .putIfNotZero ;
3940import static com .mongodb .operation .OperationHelper .LOGGER ;
40- import static com .mongodb .operation .OperationHelper .validateCollation ;
4141import static com .mongodb .operation .OperationHelper .releasingCallback ;
42+ import static com .mongodb .operation .OperationHelper .validateCollation ;
4243import static com .mongodb .operation .OperationHelper .withConnection ;
4344import static com .mongodb .operation .WriteConcernHelper .appendWriteConcernToCommand ;
4445import static com .mongodb .operation .WriteConcernHelper .writeConcernErrorTransformer ;
@@ -200,7 +201,9 @@ public CreateCollectionOperation sizeInBytes(final long sizeInBytes) {
200201 * @return usePowerOf2Sizes became the default allocation strategy
201202 * @mongodb.driver.manual reference/command/collMod/#usePowerOf2Sizes usePowerOf2Sizes
202203 * @mongodb.server.release 2.6
204+ * @deprecated As of MongoDB 3.0, power of 2 sizes is ignored by the MongoDB server
203205 */
206+ @ Deprecated
204207 public Boolean isUsePowerOf2Sizes () {
205208 return usePowerOf2Sizes ;
206209 }
@@ -214,7 +217,9 @@ public Boolean isUsePowerOf2Sizes() {
214217 * @return this
215218 * @mongodb.driver.manual reference/command/collMod/#usePowerOf2Sizes usePowerOf2Sizes
216219 * @mongodb.server.release 2.6
220+ * @deprecated As of MongoDB 3.0, power of 2 sizes is ignored by the MongoDB server
217221 */
222+ @ Deprecated
218223 public CreateCollectionOperation usePowerOf2Sizes (final Boolean usePowerOf2Sizes ) {
219224 this .usePowerOf2Sizes = usePowerOf2Sizes ;
220225 return this ;
@@ -414,7 +419,7 @@ private BsonDocument getCommand(final ConnectionDescription description) {
414419 putIfNotZero (document , "max" , maxDocuments );
415420 }
416421 if (usePowerOf2Sizes != null ) {
417- document .put ("usePowerOfTwoSizes " , BsonBoolean . valueOf ( usePowerOf2Sizes ));
422+ document .put ("flags " , new BsonInt32 ( 1 ));
418423 }
419424 if (storageEngineOptions != null ) {
420425 document .put ("storageEngine" , storageEngineOptions );
0 commit comments