Exemple #1
0
        public RecordDataUpdateResult applyUpdate(RecordUpdate update)
        {
            if ((state == RecordDataState.FULL) || (state == RecordDataState.DELETED)) {
                // throw new Exception("applyUpdate() called on fully populated record!");
                Debug.WriteLine("warn: applyUpdate() called on fully populated record. ignoring.");
                return RecordDataUpdateResult.FINAL;
            }
            switch (update.type) {
                case RecordUpdateTypes.DELETION_TOMBSTONE:
                    this.state = RecordDataState.DELETED;
                    return RecordDataUpdateResult.FINAL;

                case RecordUpdateTypes.FULL:
                    this.state = RecordDataState.FULL;
                    this.data = update.data;
                    return RecordDataUpdateResult.FINAL;

                case RecordUpdateTypes.NONE:
                    return RecordDataUpdateResult.SUCCESS;

                case RecordUpdateTypes.PARTIAL:
                    throw new Exception("partial update not implemented");

                default:
                    throw new Exception("unknown update type");

            }
        }
Exemple #2
0
 public RecordData(RecordDataState initialState, RecordKey key)
 {
     this.key = key;
     this.state = initialState;
     this.data = new byte[0];
 }