subfile.analyze_new_block(block_buf, bytes);
refs = subfile.create_incremental(tss, o, block_age);
} else {
+ if (flag_rebuild_statcache && ref.is_normal()) {
+ subfile.analyze_new_block(block_buf, bytes);
+ subfile.store_analyzed_signatures(ref);
+ }
refs.push_back(ref);
}
free(packed);
}
+void Subfile::store_analyzed_signatures(ObjectReference ref)
+{
+ if (analyzed_len >= 16384)
+ store_block_signatures(ref, new_block_summary);
+}
+
/* Compute an incremental representation of the most recent block analyzed. */
enum subfile_item_type { SUBFILE_COPY, SUBFILE_NEW };
o->write(tss);
ObjectReference ref = o->get_ref();
db->StoreObject(ref, block_csum, analyzed_len, block_age);
- if (analyzed_len >= 16384)
- store_block_signatures(ref, new_block_summary);
+ store_analyzed_signatures(ref);
ref.set_range(0, analyzed_len, true);
refs.push_back(ref);
delete o;
// buffer until all operations referring to it are finished.
void analyze_new_block(const char *buf, size_t len);
+ // Store the signatures for the most recently-analyzed block in the local
+ // database (linked to the specified object), if the block is sufficiently
+ // large. If signatures already exist, they will be overwritten.
+ void store_analyzed_signatures(ObjectReference ref);
+
std::list<ObjectReference> create_incremental(TarSegmentStore *tss,
LbsObject *o,
double block_age);