Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
4eUeP committed May 17, 2024
1 parent 6dbeb98 commit 94da7e8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
12 changes: 6 additions & 6 deletions hstream-store/HStream/Store/Internal/LogDevice/LogAttributes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ peekLogAttributes ptr = do
runPeek NodeLocationScope $ \_ARG(syncReplicationScope) ->
runPeekMaybeListPair replicateAcross_size $ \_MAYBE_LIST_PAIR(replicateAcross) ->
runPeekMaybe id $ \_MAYBE_ARG(backlogDuration) ->
runPeek cbool2bool $ \_ARG(logScdEnabled) ->
runPeek cbool2bool $ \_ARG(logLocalScdEnabled) ->
runPeek cbool2bool $ \_ARG(logStickyCopySets) ->
runPeek cbool2bool $ \_ARG(scdEnabled) ->
runPeek cbool2bool $ \_ARG(localScdEnabled) ->
runPeek cbool2bool $ \_ARG(stickyCopySets) ->
peek_log_attributes
ptr
_ARG(replicationFactor)
Expand All @@ -212,9 +212,9 @@ peekLogAttributes ptr = do
_ARG(syncReplicationScope)
_MAYBE_LIST_PAIR(replicateAcross)
_MAYBE_ARG(backlogDuration)
_ARG(logScdEnabled)
_ARG(logLocalScdEnabled)
_ARG(logStickyCopySets)
_ARG(scdEnabled)
_ARG(localScdEnabled)
_ARG(stickyCopySets)
logAttrsExtras <- peekLogAttributesExtras ptr
return LogAttributes{..}
#undef _ARG
Expand Down
12 changes: 5 additions & 7 deletions hstream-store/cbits/logdevice/hs_log_attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ poke_log_attributes(_ARG(int, replicationFactor), _ARG(int, syncedCopies),
syncReplicationScope),
_LIST_PAIR(replicateAcross,
facebook::logdevice::NodeLocationScope, HsInt),
_MAYBE_ARG(int, backlogDuration),
_ARG(bool, scdEnabled), _ARG(bool, localScdEnabled),
_ARG(bool, stickyCopySets),
_MAYBE_ARG(int, backlogDuration), _ARG(bool, scdEnabled),
_ARG(bool, localScdEnabled), _ARG(bool, stickyCopySets),
//
HsInt extras_len, StgArrBytes** keys, StgArrBytes** vals) {
#undef _ARG
Expand Down Expand Up @@ -84,9 +83,8 @@ void peek_log_attributes(
ARG(facebook::logdevice::NodeLocationScope, syncReplicationScope),
ARG_LIST_PAIR(replicateAcross, facebook::logdevice::NodeLocationScope,
HsInt),
ARG_MAYBE(HsInt, backlogDuration),
ARG(bool, scdEnabled), ARG(bool, localScdEnabled),
ARG(bool, stickyCopySets))
ARG_MAYBE(HsInt, backlogDuration), ARG(bool, scdEnabled),
ARG(bool, localScdEnabled), ARG(bool, stickyCopySets))
#undef ARG
#undef ARG_MAYBE
#undef ARG_LIST_PAIR
Expand All @@ -111,7 +109,7 @@ void peek_log_attributes(
*name##_inh = attrs->name().isInherited(); \
if (name##_len > 0 && attrs->name().hasValue()) { \
auto& val = attrs->name().value(); \
for (int i = 0; i < name##_len; i++) { \
for (int i = 0; i < name##_len; i++) { \
name##_keys[i] = val[i].first; \
name##_vals[i] = val[i].second; \
} \
Expand Down
4 changes: 2 additions & 2 deletions hstream-store/test/HStream/Store/LogDeviceSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ logdirSpec :: Spec
logdirSpec = describe "LogDirectory" $ do
let attrs = S.def{ I.logReplicationFactor = I.defAttr1 1
, I.logBacklogDuration = I.defAttr1 (Just 60)
, I.logAttrsExtras = Map.fromList [("A", "B")]
, I.logScdEnabled = I.defAttr1 False
, I.logLocalScdEnabled = I.defAttr1 True
, I.logStickyCopySets = I.defAttr1 False
, I.logAttrsExtras = Map.fromList [("A", "B")]
}

it "get log directory children name" $ do
Expand Down Expand Up @@ -97,10 +97,10 @@ loggroupAround' =
let attrs = S.def{ I.logReplicationFactor = I.defAttr1 1
, I.logBacklogDuration = I.defAttr1 (Just 60)
, I.logSingleWriter = I.defAttr1 True
, I.logSyncReplicationScope = I.defAttr1 S.NodeLocationScope_DATA_CENTER
, I.logScdEnabled = I.defAttr1 False
, I.logLocalScdEnabled = I.defAttr1 True
, I.logStickyCopySets = I.defAttr1 False
, I.logSyncReplicationScope = I.defAttr1 S.NodeLocationScope_DATA_CENTER
, I.logAttrsExtras = Map.fromList [("A", "B")]
}
logid = 105
Expand Down

0 comments on commit 94da7e8

Please sign in to comment.