removed static helper methods from DiskWriteAttributesImpl
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/67dfa05c Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/67dfa05c Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/67dfa05c Branch: refs/heads/feature/GEODE-1464 Commit: 67dfa05c0d4f446a8ccb83cddf02317f445ed7ad Parents: 620df63 Author: Darrel Schneider <[email protected]> Authored: Wed Jun 1 17:00:09 2016 -0700 Committer: Darrel Schneider <[email protected]> Committed: Wed Jun 1 17:00:09 2016 -0700 ---------------------------------------------------------------------- .../internal/cache/DiskWriteAttributesImpl.java | 74 -------------------- 1 file changed, 74 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/67dfa05c/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskWriteAttributesImpl.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskWriteAttributesImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskWriteAttributesImpl.java index cb756c7..aec646a 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskWriteAttributesImpl.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskWriteAttributesImpl.java @@ -468,78 +468,4 @@ public final class DiskWriteAttributesImpl implements DiskWriteAttributes { return DEFAULT_SYNC_DWA; } - - - // Asif: Sql Fabric related helper methods. - // These static functions need to be moved to a better place. - // preferably in sql Fabric source tree but since GatewayImpl is also - // utilizing it, we have no option but to keep it here. - public static String generateOverFlowDirName(String dirName) { - dirName = generatePersistentDirName(dirName); - final GemFireCacheImpl cache = GemFireCacheImpl.getInstance(); - if (cache == null) { - throw new CacheClosedException( - "DiskWriteAttributesImpl::generateOverFlowDirName: no cache found."); - } - /* [sumedh] no need of below since sys-disk-dir is VM specific anyways - char fileSeparator = System.getProperty("file.separator").charAt(0); - DistributedMember member = cache.getDistributedSystem() - .getDistributedMember(); - String host = member.getHost(); - int pid = member.getProcessId(); - final StringBuilder temp = new StringBuilder(dirName); - temp.append(fileSeparator); - temp.append(host); - temp.append('-'); - temp.append(pid); - return temp.toString(); - */ - return dirName; - } - - public static String generatePersistentDirName(String dirPath) { - String baseDir = "."; - if (dirPath != null) { - File dirProvided = new File(dirPath); - // Is the directory path absolute? - // For Windows this will check for drive letter. However, we want - // to allow for no drive letter so prepend the drive. - boolean isAbsolute = dirProvided.isAbsolute(); - if (!isAbsolute) { - String driveName; - // get the current drive for Windows and prepend - if ((dirPath.charAt(0) == '/' || dirPath.charAt(0) == '\\') - && (driveName = getCurrentDriveName()) != null) { - isAbsolute = true; - dirPath = driveName + dirPath; - } - } - if (!isAbsolute) { - // relative path so resolve it relative to parent dir - dirPath = new File(baseDir, dirPath).getAbsolutePath(); - } - } - else { - dirPath = baseDir; - } - return dirPath; - } - - /** - * Get the drive name of current working directory for windows else return - * null for non-Windows platform (somewhat of a hack -- see if something - * cleaner can be done for this). - */ - public static String getCurrentDriveName() { - if (System.getProperty("os.name").startsWith("Windows")) { - try { - // get the current drive - return new File(".").getCanonicalPath().substring(0, 2); - } catch (IOException ex) { - throw new IllegalArgumentException( - "Failed in setting the overflow directory", ex); - } - } - return null; - } }
