Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. WriteBatchInternal::SetSequence(updates, last_sequence + 1);
  2. last_sequence += WriteBatchInternal::Count(updates);
  3.  
  4. while (!input.empty()) {
  5. found++;
  6. char tag = input[0];
  7. input.remove_prefix(1);
  8. switch (tag) {
  9. case kTypeValue:
  10. if (GetLengthPrefixedSlice(&input, &key) &&
  11. GetLengthPrefixedSlice(&input, &value)) {
  12. handler->Put(key, value);
  13. } else {
  14. return Status::Corruption("bad WriteBatch Put");
  15. }
  16. break;
  17. case kTypeDeletion:
  18. if (GetLengthPrefixedSlice(&input, &key)) {
  19. handler->Delete(key);
  20. } else {
  21. return Status::Corruption("bad WriteBatch Delete");
  22. }
  23. break;
  24. default:
  25. return Status::Corruption("unknown WriteBatch tag");
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement