Revision 46588
Added by Claudio Atzori about 7 years ago
MongoMDStore.java | ||
---|---|---|
44 | 44 |
private MongoCollection<MDStoreRecord> discardedCollection; |
45 | 45 |
private MetadataRepository metadata; |
46 | 46 |
|
47 |
public MongoMDStore(final String id,
|
|
47 |
MongoMDStore(final String id, |
|
48 | 48 |
final MongoCollection<MDStoreRecord> collection, |
49 | 49 |
final MongoCollection<MDStoreRecord> discarded, |
50 | 50 |
final MetadataRepository metadata) { |
... | ... | |
92 | 92 |
} |
93 | 93 |
}); |
94 | 94 |
queue.put(sentinel); |
95 |
countStored = count.get().intValue();
|
|
95 |
countStored = count.get(); |
|
96 | 96 |
} catch (final InterruptedException | ExecutionException | IllegalStateException e) { |
97 | 97 |
log.error("Error on feeding mdstore with id:" + id, e); |
98 | 98 |
throw new IllegalStateException(e); |
... | ... | |
234 | 234 |
return id; |
235 | 235 |
} |
236 | 236 |
|
237 |
public void setId(final String id) { |
|
238 |
this.id = id; |
|
239 |
} |
|
240 |
|
|
241 |
public MongoCollection<MDStoreRecord> getRecordCollection() { |
|
242 |
return recordCollection; |
|
243 |
} |
|
244 |
|
|
245 |
public void setRecordCollection(final MongoCollection<MDStoreRecord> recordCollection) { |
|
246 |
this.recordCollection = recordCollection; |
|
247 |
} |
|
248 |
|
|
249 | 237 |
@Override |
250 | 238 |
public long getSize() { |
251 | 239 |
return metadata.findByMdId(getId()).getSize(); |
252 | 240 |
} |
253 | 241 |
|
254 |
public MongoCollection<MDStoreRecord> getDiscardedCollection() { |
|
255 |
return discardedCollection; |
|
256 |
} |
|
257 |
|
|
258 |
public void setDiscardedCollection(final MongoCollection<MDStoreRecord> discardedCollection) { |
|
259 |
this.discardedCollection = discardedCollection; |
|
260 |
} |
|
261 |
|
|
262 | 242 |
} |
Also available in: Unified diff
unit tests, cleanup