Change flag_checksum -> flag_no_checksum for consistency

This commit is contained in:
Scott Lystig Fritchie 2015-10-08 20:41:59 +09:00
parent 2bfc199294
commit 952d2fa508
2 changed files with 17 additions and 8 deletions

View file

@ -40,6 +40,11 @@ enum Mpb_GeneralStatusCode {
BAD_ARG = 1; BAD_ARG = 1;
WEDGED = 2; WEDGED = 2;
BAD_CHECKSUM = 3; BAD_CHECKSUM = 3;
/*
** There is no timout error code, only PARTITION. If the client
** wants to know if a lot of time has elapsed, then the client
** can do its own timekeeping.
*/
PARTITION = 4; PARTITION = 4;
NOT_WRITTEN = 5; NOT_WRITTEN = 5;
WRITTEN = 6; WRITTEN = 6;
@ -188,11 +193,13 @@ message Mpb_ReadChunkReq {
required uint64 offset = 2; required uint64 offset = 2;
required uint32 size = 3; required uint32 size = 3;
// Use flag_checksum=non-zero to request the chunk's checksum also // Use flag_no_checksum=non-zero to skip returning the chunk's checksum.
optional uint32 flag_checksum = 4 [default=0]; // TODO: not implemented yet.
optional uint32 flag_no_checksum = 4 [default=0];
// Use flag_no_chunk=non-zero to skip returning the chunk (which // Use flag_no_chunk=non-zero to skip returning the chunk (which
// only makes sense if flag_checksum is set). // only makes sense if flag_no_checksum is not set).
// TODO: not implemented yet.
optional uint32 flag_no_chunk = 5 [default=0]; optional uint32 flag_no_chunk = 5 [default=0];
} }
@ -385,11 +392,13 @@ message Mpb_LL_ReadChunkReq {
required uint64 offset = 3; required uint64 offset = 3;
required uint32 size = 4; required uint32 size = 4;
// Use flag_checksum=non-zero to request the chunk's checksum also // Use flag_no_checksum=non-zero to skip returning the chunk's checksum.
optional uint32 flag_get_checksum = 5 [default=0]; // TODO: not implemented yet.
optional uint32 flag_no_checksum = 5 [default=0];
// Use flag_no_chunk=non-zero to skip returning the chunk (which // Use flag_no_chunk=non-zero to skip returning the chunk (which
// only makes sense if flag_checksum is set). // only makes sense if flag_checksum is not set).
// TODO: not implemented yet.
optional uint32 flag_no_chunk = 6 [default=0]; optional uint32 flag_no_chunk = 6 [default=0];
} }

View file

@ -76,10 +76,10 @@ from_pb_request(#mpb_ll_request{
file=File, file=File,
offset=Offset, offset=Offset,
size=Size, size=Size,
flag_get_checksum=PB_GetChecksum, flag_no_checksum=PB_GetNoChecksum,
flag_no_chunk=PB_GetNoChunk}}) -> flag_no_chunk=PB_GetNoChunk}}) ->
EpochID = conv_to_epoch_id(PB_EpochID), EpochID = conv_to_epoch_id(PB_EpochID),
Opts = [{get_checksum, conv_to_boolean(PB_GetChecksum)}, Opts = [{no_checksum, conv_to_boolean(PB_GetNoChecksum)},
{no_chunk, conv_to_boolean(PB_GetNoChunk)}], {no_chunk, conv_to_boolean(PB_GetNoChunk)}],
{ReqID, {low_read_chunk, EpochID, File, Offset, Size, Opts}}; {ReqID, {low_read_chunk, EpochID, File, Offset, Size, Opts}};
from_pb_request(#mpb_ll_request{ from_pb_request(#mpb_ll_request{