MCPcopy Create free account
hub / github.com/apache/mesos / read

Method read

src/state/leveldb.cpp:227–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225
226
227Try<Option<Entry>> LevelDBStorageProcess::read(const string& name)
228{
229 CHECK_NONE(error);
230
231 leveldb::ReadOptions options;
232
233 string value;
234
235 leveldb::Status status = db->Get(options, name, &value);
236
237 if (status.IsNotFound()) {
238 return None();
239 } else if (!status.ok()) {
240 return Error(status.ToString());
241 }
242
243 google::protobuf::io::ArrayInputStream stream(value.data(), value.size());
244
245 Entry entry;
246
247 if (!entry.ParseFromZeroCopyStream(&stream)) {
248 return Error("Failed to deserialize Entry");
249 }
250
251 return Some(entry);
252}
253
254
255Try<bool> LevelDBStorageProcess::write(const Entry& entry)

Callers 9

_startMethod · 0.45
__startMethod · 0.45
apiMethod · 0.45
readFileMethod · 0.45
connectFunction · 0.45
handlerMethod · 0.45
attachContainerInputMethod · 0.45
foreachFunction · 0.45
foreachFunction · 0.45

Calls 6

NoneClass · 0.85
SomeFunction · 0.85
GetMethod · 0.80
dataMethod · 0.80
ErrorFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected