Skip to content

Commit

Permalink
refactoring index meta service
Browse files Browse the repository at this point in the history
  • Loading branch information
anidotnet committed Apr 8, 2018
1 parent 171cc37 commit 1f7e8d5
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@
*/
class IndexMetaService {
private final NitriteMap<NitriteId, Document> underlyingMap;
private final NitriteMap<String, IndexMeta> indexMetadata;
private final Map<String, Object> fieldLock;
private final NitriteStore mvStore;

IndexMetaService(NitriteMap<NitriteId, Document> underlyingMap) {
this.underlyingMap = underlyingMap;
this.mvStore = underlyingMap.getStore();
indexMetadata = getIndexMetadata();
this.fieldLock = new ConcurrentHashMap<>();
}

NitriteMap<NitriteId, Document> getUnderlyingMap() {
Expand Down Expand Up @@ -147,15 +143,6 @@ Index createIndexMetadata(String field, IndexType indexType) {
return index;
}

synchronized Object getFieldLock(String field) {
Object lock = fieldLock.get(field);
if (lock != null) return lock;

lock = new Object();
fieldLock.put(field, lock);
return lock;
}

private String getName() {
return INDEX_META_PREFIX + INTERNAL_NAME_SEPARATOR + underlyingMap.getName();
}
Expand Down

0 comments on commit 1f7e8d5

Please sign in to comment.