📄 abstractcluster.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// This file is// Copyright (C) 2003-@year@ Per Nyfelt. All rights reserved.//package org.ozoneDB.core.storage;import org.ozoneDB.core.Env;import org.ozoneDB.core.Permissions;import org.ozoneDB.core.ObjectID;import org.ozoneDB.DxLib.DxMap;/** * @author Per Nyfelt */public abstract class AbstractCluster implements Cluster { /** * The environment. Will be set by the clusterStore. */ public transient Env env; public transient AbstractClusterStore clusterStore; protected Permissions permissions; protected ClusterID clusterID; /** * Maps ObjectIDs into StorageObjectContainers. */ protected DxMap containers; public DxMap containers() { return containers; } public Env env() { return env; } public void setEnv(Env _env) { this.env = _env; } public void setClusterStore(AbstractClusterStore _clusterStore) { this.clusterStore = _clusterStore; } public Permissions permissions() { return permissions; } public ClusterID clusterID() { return clusterID; } public StorageObjectContainer containerForID(ObjectID id) { return (StorageObjectContainer) containers.elementForKey(id); } public void removeContainer(StorageObjectContainer container) { if (containers.removeForKey(container.id()) == null) { throw new IllegalStateException("Unable to remove container from cluster."); } } public void registerContainer(StorageObjectContainer container) { synchronized (container) { container.setCluster(this); if (containers.addForKey(container, container.id()) == false) { throw new IllegalStateException("Unable to add id " + container.id() + " to cluster " + clusterID()); } } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -