Browse files

issue40: allow support for partial results from shards

  • Loading branch information...
agirbal committed Nov 16, 2011
1 parent e63b2fc commit 7bc9ad960f261fdc9fd1d88a99b5e8a76cd5df42
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -20,6 +20,7 @@
<CheckBox id="tailable" toolTipText="Tailable means cursor is not closed when the last data is retrieved. You can resume using the cursor later, if more data exists."/>
<CheckBox id="awaitData" toolTipText="Use with TailableCursor. If cursor is at the end of the data, it blocks for a while rather than returning no data."/>
<CheckBox id="exhaust" toolTipText="Stream the data down full blast in multiple 'getMore' packages, on the assumption that the client will fully read all data queried."/>
+ <CheckBox id="partial" toolTipText="Allows mongos to return partial results from a sharded system if any shard is down."/>
<CheckBox id="opLogReplay" toolTipText="Internal replication use only - driver should not set"/>
<Div id="writeConcern">
@@ -8,8 +8,6 @@
import com.edgytech.swingfast.ComboBox;
import com.edgytech.swingfast.FormDialog;
import com.mongodb.Bytes;
-import com.mongodb.MongoException;
-import com.mongodb.MongoOptions;
import com.mongodb.ReadPreference;
import com.mongodb.WriteConcern;
@@ -25,6 +23,7 @@
+ partial,
@@ -44,6 +43,7 @@ void update(int options, WriteConcern wc, ReadPreference rp) {
setBooleanFieldValue(Item.noTimeout, (options & Bytes.QUERYOPTION_NOTIMEOUT) != 0);
setBooleanFieldValue(Item.awaitData, (options & Bytes.QUERYOPTION_AWAITDATA) != 0);
setBooleanFieldValue(Item.exhaust, (options & Bytes.QUERYOPTION_EXHAUST) != 0);
+ setBooleanFieldValue(Item.partial, (options & Bytes.QUERYOPTION_PARTIAL) != 0);
Object w = wc.getWObject();
int wInt = (Integer) (w instanceof Integer ? w : 0);
@@ -70,6 +70,7 @@ int getQueryOptions() {
if (getBooleanFieldValue(Item.noTimeout)) options |= Bytes.QUERYOPTION_NOTIMEOUT;
if (getBooleanFieldValue(Item.awaitData)) options |= Bytes.QUERYOPTION_AWAITDATA;
if (getBooleanFieldValue(Item.exhaust)) options |= Bytes.QUERYOPTION_EXHAUST;
+ if (getBooleanFieldValue(Item.partial)) options |= Bytes.QUERYOPTION_PARTIAL;
return options;

0 comments on commit 7bc9ad9

Please sign in to comment.