Permalink
Browse files

Added waitToBeVisible to the rowmutation object.

  • Loading branch information...
1 parent e8b5913 commit 961092c22a10df6bc64684b58ade72e826a66c72 @amccurry amccurry committed Mar 12, 2012
View
@@ -296,7 +296,8 @@ struct RowMutation {
2:string rowId,
3:bool wal = 1,
4:RowMutationType rowMutationType,
- 5:list<RecordMutation> recordMutations
+ 5:list<RecordMutation> recordMutations,
+ 6:bool waitToBeVisible
}
@@ -221,6 +221,7 @@
<tr><td>3</td><td>wal</td><td><code>bool</code></td><td></td><td>default</td><td>1</td></tr>
<tr><td>4</td><td>rowMutationType</td><td><code><a href="Blur.html#Enum_RowMutationType">RowMutationType</a></code></td><td></td><td>default</td><td></td></tr>
<tr><td>5</td><td>recordMutations</td><td><code>list&lt;<code><a href="Blur.html#Struct_RecordMutation">RecordMutation</a></code>&gt;</code></td><td></td><td>default</td><td></td></tr>
+<tr><td>6</td><td>waitToBeVisible</td><td><code>bool</code></td><td></td><td>default</td><td></td></tr>
</table><br/></div><div class="definition"><h3 id="Struct_CpuTime">Struct: CpuTime</h3>
<table><tr><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Default value</th></tr>
<tr><td>1</td><td>cpuTime</td><td><code>i64</code></td><td></td><td>default</td><td></td></tr>
Oops, something went wrong.
@@ -1897,7 +1897,7 @@ sub write {
package Blur::RowMutation;
use base qw(Class::Accessor);
-Blur::RowMutation->mk_accessors( qw( table rowId wal rowMutationType recordMutations ) );
+Blur::RowMutation->mk_accessors( qw( table rowId wal rowMutationType recordMutations waitToBeVisible ) );
sub new {
my $classname = shift;
@@ -1908,6 +1908,7 @@ sub new {
$self->{wal} = 1;
$self->{rowMutationType} = undef;
$self->{recordMutations} = undef;
+ $self->{waitToBeVisible} = undef;
if (UNIVERSAL::isa($vals,'HASH')) {
if (defined $vals->{table}) {
$self->{table} = $vals->{table};
@@ -1924,6 +1925,9 @@ sub new {
if (defined $vals->{recordMutations}) {
$self->{recordMutations} = $vals->{recordMutations};
}
+ if (defined $vals->{waitToBeVisible}) {
+ $self->{waitToBeVisible} = $vals->{waitToBeVisible};
+ }
}
return bless ($self, $classname);
}
@@ -1990,6 +1994,12 @@ sub read {
$xfer += $input->skip($ftype);
}
last; };
+ /^6$/ && do{ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool(\$self->{waitToBeVisible});
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ last; };
$xfer += $input->skip($ftype);
}
$xfer += $input->readFieldEnd();
@@ -2036,6 +2046,11 @@ sub write {
}
$xfer += $output->writeFieldEnd();
}
+ if (defined $self->{waitToBeVisible}) {
+ $xfer += $output->writeFieldBegin('waitToBeVisible', TType::BOOL, 6);
+ $xfer += $output->writeBool($self->{waitToBeVisible});
+ $xfer += $output->writeFieldEnd();
+ }
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
Oops, something went wrong.
@@ -630,13 +630,13 @@ public void mutate(RowMutation mutation) throws BlurException, IOException {
switch (type) {
case REPLACE_ROW:
Row row = MutationHelper.getRowFromMutations(mutation.rowId, mutation.recordMutations);
- blurIndex.replaceRow(mutation.wal, row);
+ blurIndex.replaceRow(mutation.waitToBeVisible, mutation.wal, row);
break;
case UPDATE_ROW:
doUpdateRowMutation(mutation, blurIndex);
break;
case DELETE_ROW:
- blurIndex.deleteRow(mutation.wal, mutation.rowId);
+ blurIndex.deleteRow(mutation.waitToBeVisible, mutation.wal, mutation.rowId);
break;
default:
throw new RuntimeException("Not supported [" + type + "]");
@@ -698,7 +698,7 @@ private void doUpdateRowMutation(RowMutation mutation, BlurIndex blurIndex) thro
}
// Finally, replace the existing row with the new row we have built.
- blurIndex.replaceRow(mutation.wal, newRow);
+ blurIndex.replaceRow(mutation.waitToBeVisible, mutation.wal, newRow);
} else {
throw new BException("Mutation cannot update row that does not exist.", mutation);
}
@@ -9,16 +9,16 @@
public abstract class BlurIndex {
- public abstract void replaceRow(boolean wal, Row row) throws IOException;
+ public abstract void replaceRow(boolean waitToBeVisible, boolean wal, Row row) throws IOException;
+
+ public abstract void deleteRow(boolean waitToBeVisible, boolean wal, String rowId) throws IOException;
public abstract IndexReader getIndexReader(boolean forceRefresh) throws IOException;
public abstract void close() throws IOException;
public abstract void refresh() throws IOException;
- public abstract void deleteRow(boolean wal, String rowId) throws IOException;
-
public abstract AtomicBoolean isClosed();
public abstract void optimize(int numberOfSegmentsPerShard) throws IOException;
@@ -30,12 +30,12 @@ public void close() throws IOException {
}
@Override
- public void replaceRow(boolean wal, Row row) throws IOException {
+ public void replaceRow(boolean waitToBeVisible, boolean wal, Row row) throws IOException {
throw new RuntimeException("Read-only shard");
}
@Override
- public void deleteRow(boolean wal, String rowId) throws IOException {
+ public void deleteRow(boolean waitToBeVisible, boolean wal, String rowId) throws IOException {
throw new RuntimeException("Read-only shard");
}
Oops, something went wrong.

0 comments on commit 961092c

Please sign in to comment.