MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / call

Method call

src/meta/UIDMeta.java:221–250  ·  view source on GitHub ↗

Executes the CompareAndSet after merging changes @return True if the CAS was successful, false if the stored data was modified during flight.

(final ArrayList<KeyValue> row)

Source from the content-addressed store, hash-verified

219 * was modified during flight.
220 */
221 @Override
222 public Deferred<Boolean> call(final ArrayList<KeyValue> row)
223 throws Exception {
224
225 final UIDMeta stored_meta;
226 if (row == null || row.isEmpty()) {
227 stored_meta = null;
228 } else {
229 stored_meta = JSON.parseToObject(row.get(0).value(), UIDMeta.class);
230 stored_meta.initializeChangedMap();
231 }
232
233 final byte[] original_meta = row == null || row.isEmpty() ?
234 new byte[0] : row.get(0).value();
235
236 if (stored_meta != null) {
237 local_meta.syncMeta(stored_meta, overwrite);
238 }
239
240 // verify the name is set locally just to be safe
241 if (name == null || name.isEmpty()) {
242 local_meta.name = name;
243 }
244
245 final PutRequest put = new PutRequest(tsdb.uidTable(),
246 UniqueId.stringToUid(uid), FAMILY,
247 (type.toString().toLowerCase() + "_meta").getBytes(CHARSET),
248 local_meta.getStorageJSON());
249 return tsdb.getClient().compareAndSet(put, original_meta);
250 }
251
252 }
253

Callers

nothing calls this directly

Calls 12

parseToObjectMethod · 0.95
initializeChangedMapMethod · 0.95
stringToUidMethod · 0.95
isEmptyMethod · 0.80
valueMethod · 0.45
getMethod · 0.45
syncMetaMethod · 0.45
uidTableMethod · 0.45
getBytesMethod · 0.45
toStringMethod · 0.45
getStorageJSONMethod · 0.45
getClientMethod · 0.45

Tested by

no test coverage detected