29
29
import com .mongodb .operation .OperationHelper .CallableWithConnection ;
30
30
import org .bson .BsonBoolean ;
31
31
import org .bson .BsonDocument ;
32
+ import org .bson .BsonInt32 ;
32
33
import org .bson .BsonString ;
33
34
34
35
import static com .mongodb .assertions .Assertions .notNull ;
37
38
import static com .mongodb .operation .CommandOperationHelper .executeWrappedCommandProtocolAsync ;
38
39
import static com .mongodb .operation .DocumentHelper .putIfNotZero ;
39
40
import static com .mongodb .operation .OperationHelper .LOGGER ;
40
- import static com .mongodb .operation .OperationHelper .validateCollation ;
41
41
import static com .mongodb .operation .OperationHelper .releasingCallback ;
42
+ import static com .mongodb .operation .OperationHelper .validateCollation ;
42
43
import static com .mongodb .operation .OperationHelper .withConnection ;
43
44
import static com .mongodb .operation .WriteConcernHelper .appendWriteConcernToCommand ;
44
45
import static com .mongodb .operation .WriteConcernHelper .writeConcernErrorTransformer ;
@@ -200,7 +201,9 @@ public CreateCollectionOperation sizeInBytes(final long sizeInBytes) {
200
201
* @return usePowerOf2Sizes became the default allocation strategy
201
202
* @mongodb.driver.manual reference/command/collMod/#usePowerOf2Sizes usePowerOf2Sizes
202
203
* @mongodb.server.release 2.6
204
+ * @deprecated As of MongoDB 3.0, power of 2 sizes is ignored by the MongoDB server
203
205
*/
206
+ @ Deprecated
204
207
public Boolean isUsePowerOf2Sizes () {
205
208
return usePowerOf2Sizes ;
206
209
}
@@ -214,7 +217,9 @@ public Boolean isUsePowerOf2Sizes() {
214
217
* @return this
215
218
* @mongodb.driver.manual reference/command/collMod/#usePowerOf2Sizes usePowerOf2Sizes
216
219
* @mongodb.server.release 2.6
220
+ * @deprecated As of MongoDB 3.0, power of 2 sizes is ignored by the MongoDB server
217
221
*/
222
+ @ Deprecated
218
223
public CreateCollectionOperation usePowerOf2Sizes (final Boolean usePowerOf2Sizes ) {
219
224
this .usePowerOf2Sizes = usePowerOf2Sizes ;
220
225
return this ;
@@ -414,7 +419,7 @@ private BsonDocument getCommand(final ConnectionDescription description) {
414
419
putIfNotZero (document , "max" , maxDocuments );
415
420
}
416
421
if (usePowerOf2Sizes != null ) {
417
- document .put ("usePowerOfTwoSizes " , BsonBoolean . valueOf ( usePowerOf2Sizes ));
422
+ document .put ("flags " , new BsonInt32 ( 1 ));
418
423
}
419
424
if (storageEngineOptions != null ) {
420
425
document .put ("storageEngine" , storageEngineOptions );
0 commit comments