/** Validate and set ctime from {@link Properties}*/ protected void setcTime(Properties props, StorageDirectory sd) throws InconsistentFSStateException { cTime = Long.parseLong(getProperty(props, sd, "cTime")); }
/** Validate and set namespaceID version from {@link Properties}*/ protected void setNamespaceID(Properties props, StorageDirectory sd) throws InconsistentFSStateException { int nsId = Integer.parseInt(getProperty(props, sd, "namespaceID")); if (namespaceID != 0 && nsId != 0 && namespaceID != nsId) { throw new InconsistentFSStateException(sd.root, "namespaceID is incompatible with others."); } namespaceID = nsId; }
/** Validate and set layout version from {@link Properties}*/ protected void setLayoutVersion(Properties props, StorageDirectory sd) throws IncorrectVersionException, InconsistentFSStateException { int lv = Integer.parseInt(getProperty(props, sd, "layoutVersion")); if (lv < getServiceLayoutVersion()) { // future version throw new IncorrectVersionException(getServiceLayoutVersion(), lv, "storage directory " + sd.root.getAbsolutePath()); } layoutVersion = lv; }
/** Validate and set clusterId from {@link Properties}*/ protected void setClusterId(Properties props, int layoutVersion, StorageDirectory sd) throws InconsistentFSStateException { // Set cluster ID in version that supports federation if (LayoutVersion.supports(getServiceLayoutFeatureMap(), Feature.FEDERATION, layoutVersion)) { String cid = getProperty(props, sd, "clusterID"); if (!(clusterID.equals("") || cid.equals("") || clusterID.equals(cid))) { throw new InconsistentFSStateException(sd.getRoot(), "cluster Id is incompatible with others."); } clusterID = cid; } }
/** Validate and set storage type from {@link Properties}*/ protected void checkStorageType(Properties props, StorageDirectory sd) throws InconsistentFSStateException { if (storageType == null) { //don't care about storage type return; } NodeType type = NodeType.valueOf(getProperty(props, sd, "storageType")); if (!storageType.equals(type)) { throw new InconsistentFSStateException(sd.root, "Incompatible node types: storageType=" + storageType + " but StorageDirectory type=" + type); } }
/** Validate and set ctime from {@link Properties}*/ protected void setcTime(Properties props, StorageDirectory sd) throws InconsistentFSStateException { cTime = Long.parseLong(getProperty(props, sd, "cTime")); }
/** Validate and set ctime from {@link Properties}*/ protected void setcTime(Properties props, StorageDirectory sd) throws InconsistentFSStateException { cTime = Long.parseLong(getProperty(props, sd, "cTime")); }
/** Validate and set namespaceID version from {@link Properties}*/ protected void setNamespaceID(Properties props, StorageDirectory sd) throws InconsistentFSStateException { int nsId = Integer.parseInt(getProperty(props, sd, "namespaceID")); if (namespaceID != 0 && nsId != 0 && namespaceID != nsId) { throw new InconsistentFSStateException(sd.root, "namespaceID is incompatible with others."); } namespaceID = nsId; }
/** Validate and set namespaceID version from {@link Properties}*/ protected void setNamespaceID(Properties props, StorageDirectory sd) throws InconsistentFSStateException { int nsId = Integer.parseInt(getProperty(props, sd, "namespaceID")); if (namespaceID != 0 && nsId != 0 && namespaceID != nsId) { throw new InconsistentFSStateException(sd.root, "namespaceID is incompatible with others."); } namespaceID = nsId; }
/** Validate and set layout version from {@link Properties}*/ protected void setLayoutVersion(Properties props, StorageDirectory sd) throws IncorrectVersionException, InconsistentFSStateException { int lv = Integer.parseInt(getProperty(props, sd, "layoutVersion")); if (lv < getServiceLayoutVersion()) { // future version throw new IncorrectVersionException(getServiceLayoutVersion(), lv, "storage directory " + sd.root.getAbsolutePath()); } layoutVersion = lv; }
/** Validate and set layout version from {@link Properties}*/ protected void setLayoutVersion(Properties props, StorageDirectory sd) throws IncorrectVersionException, InconsistentFSStateException { int lv = Integer.parseInt(getProperty(props, sd, "layoutVersion")); if (lv < getServiceLayoutVersion()) { // future version throw new IncorrectVersionException(getServiceLayoutVersion(), lv, "storage directory " + sd.root.getAbsolutePath()); } layoutVersion = lv; }
/** Validate and set clusterId from {@link Properties}*/ protected void setClusterId(Properties props, int layoutVersion, StorageDirectory sd) throws InconsistentFSStateException { // Set cluster ID in version that supports federation if (LayoutVersion.supports(getServiceLayoutFeatureMap(), Feature.FEDERATION, layoutVersion)) { String cid = getProperty(props, sd, "clusterID"); if (!(clusterID.equals("") || cid.equals("") || clusterID.equals(cid))) { throw new InconsistentFSStateException(sd.getRoot(), "cluster Id is incompatible with others."); } clusterID = cid; } }
/** Validate and set clusterId from {@link Properties}*/ protected void setClusterId(Properties props, int layoutVersion, StorageDirectory sd) throws InconsistentFSStateException { // Set cluster ID in version that supports federation if (LayoutVersion.supports(getServiceLayoutFeatureMap(), Feature.FEDERATION, layoutVersion)) { String cid = getProperty(props, sd, "clusterID"); if (!(clusterID.equals("") || cid.equals("") || clusterID.equals(cid))) { throw new InconsistentFSStateException(sd.getRoot(), "cluster Id is incompatible with others."); } clusterID = cid; } }
/** Validate and set storage type from {@link Properties}*/ protected void checkStorageType(Properties props, StorageDirectory sd) throws InconsistentFSStateException { if (storageType == null) { //don't care about storage type return; } NodeType type = NodeType.valueOf(getProperty(props, sd, "storageType")); if (!storageType.equals(type)) { throw new InconsistentFSStateException(sd.root, "Incompatible node types: storageType=" + storageType + " but StorageDirectory type=" + type); } }
/** Validate and set storage type from {@link Properties}*/ protected void checkStorageType(Properties props, StorageDirectory sd) throws InconsistentFSStateException { if (storageType == null) { //don't care about storage type return; } NodeType type = NodeType.valueOf(getProperty(props, sd, "storageType")); if (!storageType.equals(type)) { throw new InconsistentFSStateException(sd.root, "Incompatible node types: storageType=" + storageType + " but StorageDirectory type=" + type); } }