MCPcopy Create free account
hub / github.com/Tencent/phxpaxos / InitLogStorage

Method InitLogStorage

src/node/pnode.cpp:74–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74int PNode :: InitLogStorage(const Options & oOptions, LogStorage *& poLogStorage)
75{
76 if (oOptions.poLogStorage != nullptr)
77 {
78 poLogStorage = oOptions.poLogStorage;
79 PLImp("OK, use user logstorage");
80 return 0;
81 }
82
83 if (oOptions.sLogStoragePath.size() == 0)
84 {
85 PLErr("LogStorage Path is null");
86 return -2;
87 }
88
89 int ret = m_oDefaultLogStorage.Init(oOptions.sLogStoragePath, oOptions.iGroupCount);
90 if (ret != 0)
91 {
92 PLErr("Init default logstorage fail, logpath %s ret %d",
93 oOptions.sLogStoragePath.c_str(), ret);
94 return ret;
95 }
96
97 poLogStorage = &m_oDefaultLogStorage;
98
99 PLImp("OK, use default logstorage");
100
101 return 0;
102}
103
104int PNode :: InitNetWork(const Options & oOptions, NetWork *& poNetWork)
105{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected