WALEdit val = new WALEdit(); e = new HLog.Entry(key, val);
p.add(FAMILY, null, Bytes.toBytes("v1")); WALEdit withPut = new WALEdit(); addMutation(withPut, p, FAMILY); edits.add(withPut); WALEdit withDelete = new WALEdit(); addMutation(withDelete, d, FAMILY); edits.add(withDelete); WALEdit withPutsAndDeletes = new WALEdit(); addMutation(withPutsAndDeletes, d, FAMILY); addMutation(withPutsAndDeletes, p, FAMILY); edits.add(withPutsAndDeletes); WALEdit justIndexUpdates = new WALEdit(); byte[] table = Bytes.toBytes("targetTable"); IndexedKeyValue ikv = new IndexedKeyValue(table, p); edits.add(justIndexUpdates); WALEdit mixed = new WALEdit(); addMutation(mixed, d, FAMILY); mixed.add(ikv);
List<WALEdit> read = new ArrayList<WALEdit>(); for (int i = 0; i < edits.size(); i++) { WALEdit edit = new WALEdit(); edit.setCodec(codec); edit.readFields(in);
public Entry() { edit = new WALEdit(); // we use HLogKey here instead of WALKey directly to support legacy coprocessors. key = new HLogKey(); }
public Entry() { edit = new WALEdit(); key = new HLogKey(); }
private WALEdit completeCacheFlushLogEdit() { KeyValue kv = new KeyValue(METAROW, METAFAMILY, null, System.currentTimeMillis(), COMPLETE_CACHE_FLUSH); WALEdit e = new WALEdit(); e.add(kv); return e; }
public static WALEdit createFlushWALEdit(HRegionInfo hri, FlushDescriptor f) { KeyValue kv = new KeyValue(getRowForRegion(hri), METAFAMILY, FLUSH, EnvironmentEdgeManager.currentTime(), f.toByteArray()); return new WALEdit().add(kv); }
/** * Create a compaction WALEdit * @param c * @return A WALEdit that has <code>c</code> serialized as its value */ public static WALEdit createCompaction(final HRegionInfo hri, final CompactionDescriptor c) { byte [] pbbytes = c.toByteArray(); KeyValue kv = new KeyValue(getRowForRegion(hri), METAFAMILY, COMPACTION, EnvironmentEdgeManager.currentTime(), pbbytes); return new WALEdit().add(kv); //replication scope null so that this won't be replicated }
public static WALEdit createRegionEventWALEdit(HRegionInfo hri, RegionEventDescriptor regionEventDesc) { KeyValue kv = new KeyValue(getRowForRegion(hri), METAFAMILY, REGION_EVENT, EnvironmentEdgeManager.currentTime(), regionEventDesc.toByteArray()); return new WALEdit().add(kv); }
/** * Create a bulk loader WALEdit * * @param hri The HRegionInfo for the region in which we are bulk loading * @param bulkLoadDescriptor The descriptor for the Bulk Loader * @return The WALEdit for the BulkLoad */ public static WALEdit createBulkLoadEvent(HRegionInfo hri, WALProtos.BulkLoadDescriptor bulkLoadDescriptor) { KeyValue kv = new KeyValue(getRowForRegion(hri), METAFAMILY, BULK_LOAD, EnvironmentEdgeManager.currentTime(), bulkLoadDescriptor.toByteArray()); return new WALEdit().add(kv); }
WALEdit val = new WALEdit(); e = new HLog.Entry(key, val);
@Override public Entry next(Entry reuse) throws IOException { Entry e = reuse; if (e == null) { // we use HLogKey here instead of WALKey directly to support legacy coprocessors, // seqencefile based readers, and HLogInputFormat. e = new Entry(new HLogKey(), new WALEdit()); } if (compressionContext != null) { e.setCompressionContext(compressionContext); } boolean hasEntry = false; try { hasEntry = readNext(e); } catch (IllegalArgumentException iae) { TableName tableName = e.getKey().getTablename(); if (tableName != null && tableName.equals(TableName.OLD_ROOT_TABLE_NAME)) { // It is old ROOT table edit, ignore it LOG.info("Got an old ROOT edit, ignoring "); return next(e); } else throw iae; } edit++; if (compressionContext != null && emptyCompressionContext) { emptyCompressionContext = false; } return hasEntry ? e : null; }
walEdits = new WALEdit();
List<Entry> newEntries = new ArrayList<Entry>(entries.size()); for (Entry entry : entries) { WALEdit newEdit = new WALEdit(); ArrayList<Cell> cells = entry.getEdit().getCells(); for (Cell cell : cells) {
WALEdit walEdit = new WALEdit();
boolean writeToWAL) throws IOException { Map<byte[], List<KeyValue>> familyMap = delete.getFamilyMap(); WALEdit walEdit = new WALEdit();
WALEdit walEdit = new WALEdit(); walEdit.add(newKv);
WALKey key = null; WALEdit val = null; if (logEntry != null) val = new WALEdit();