Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merged master #132

Open
wants to merge 117 commits into
base: dp
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
264299e
updates to rocksdb
opendedup Aug 11, 2021
bea6d6a
updated aws glacier restore and IOserver block sz
opendedup Aug 23, 2021
2c4a8c5
changed to default sha256
opendedup Aug 30, 2021
9e35e61
updated glacier restore
opendedup Oct 17, 2021
242a482
update protos for proxy
opendedup Dec 4, 2021
54e5710
updated proxy redirector
opendedup Dec 4, 2021
f8dfaf3
proto updates
opendedup Dec 4, 2021
dc8e43d
updated volumeid to be int64
opendedup Dec 6, 2021
8763727
updated log4j
opendedup Dec 14, 2021
7e12f55
updated volumeid
opendedup Dec 14, 2021
30661f2
Updated Protobuf signature
opendedup Dec 18, 2021
3a55f35
ioserver max message updates
opendedup Dec 19, 2021
b71c98f
removed pam dependency
opendedup Dec 20, 2021
18f00df
fixed log4j depenencies
opendedup Dec 20, 2021
47c6a4e
Merge branch 'dp' into master
opendedup Dec 20, 2021
0efb6a8
updated with patch
opendedup Dec 21, 2021
38f837c
updatde patch
opendedup Dec 21, 2021
9831e91
update more patching
opendedup Jan 7, 2022
cb04710
grpc api updates
opendedup Jan 8, 2022
34cae37
added encryption service
opendedup Jan 9, 2022
647fd64
added flag that encryption is enabled
opendedup Jan 10, 2022
522cc7c
cleaned dependencies
opendedup Jan 11, 2022
7ce24a9
update encryptionservice
opendedup Jan 15, 2022
0c75914
update encryption service
opendedup Jan 15, 2022
74c6cfb
updated encryptionservice
opendedup Jan 15, 2022
1e6b6fe
updated encryption service
opendedup Jan 15, 2022
2604a1a
update to io operation
opendedup Jan 16, 2022
affe698
performance
opendedup Jan 16, 2022
2aee42b
added useportredirector
opendedup Jan 16, 2022
54383ad
updated gc debugging
opendedup Jan 17, 2022
ec4b16e
fixed encryption dissalow server certificate mtl
opendedup Jan 23, 2022
92eeb20
disabled syncfl schedule by defualt
opendedup Jan 23, 2022
b784ce6
fixed filechecking
opendedup Jan 23, 2022
bc54f2e
Fixed the mtls validation issue
opendedup Jan 24, 2022
7c73153
fixed rewriting use-ssl
opendedup Jan 25, 2022
b77aaa9
removed expensive volume full check
opendedup Jan 25, 2022
37afaaf
added compression to the api
opendedup Jan 29, 2022
bd704f9
added compression to deduplication
opendedup Jan 29, 2022
5a70f24
updated compression syntax
opendedup Jan 29, 2022
c5b8520
added compression boolean
opendedup Jan 30, 2022
635606f
added compression boolean
opendedup Jan 30, 2022
89624b1
removed unused dep
opendedup Jan 30, 2022
9c2e2a4
updated to claim chunked with clientside dedupe
opendedup Feb 3, 2022
379eb98
fixed debug logging
opendedup Feb 3, 2022
2a120fb
added compression for sparse datachunk
opendedup Feb 3, 2022
5f0bde0
changed removal to every 15 minutes for certs
opendedup Feb 3, 2022
fddd196
updated debug logs
opendedup Feb 6, 2022
0842b7b
added clientside dedupe optimizations
opendedup Feb 7, 2022
15a9dcd
fixed max message size
opendedup Feb 7, 2022
fffc997
Remove keys after 15 seconds
opendedup Feb 8, 2022
01bd9a4
enabled encryption of the sha256 of the password
opendedup Feb 8, 2022
736180f
updated encryption service api
opendedup Feb 10, 2022
591facd
removed unused imports
opendedup Feb 10, 2022
0b89985
fixed shutdown issue
opendedup Feb 17, 2022
46766d3
fixed shutdown issue
opendedup Feb 17, 2022
a82e209
update rocksdb
opendedup Feb 20, 2022
d84070d
added "-j" option to determin e env var for decry
opendedup Feb 28, 2022
88ff211
added fix when bucketinfo breaks
opendedup Mar 1, 2022
e4240e9
fixed client side dedupe cloud restore issue
opendedup Mar 1, 2022
313485d
cleaned up encryption of already encryted password
opendedup Mar 1, 2022
a488c24
Merge pull request #136 from opendedup/master-dp2-merge
opendedup Mar 1, 2022
ad4038a
updated base memory to 6GB
opendedup Mar 2, 2022
3f80682
updated windows executibles
opendedup Mar 5, 2022
ffa5adf
updated windows binaries
opendedup Mar 5, 2022
52286c3
Merge branch 'master' of https://github.com/opendedup/sdfs
opendedup Mar 5, 2022
af42861
memory updates
opendedup Mar 15, 2022
15ebd18
mount sdfs set base memory to 10GB
opendedup Mar 15, 2022
58357ba
file memory errors
opendedup Mar 18, 2022
b8b109d
added abort to s3io
opendedup Mar 19, 2022
4c3eb23
cache cleanup and encryption
opendedup Mar 20, 2022
d2b7f74
Set cleanup thread conditional to encrypt
opendedup Mar 21, 2022
20c306b
Set dedupe store conditional to encryption
opendedup Mar 21, 2022
d9f4fd7
rolled back storage service changes
opendedup Mar 21, 2022
b64b811
rolled back encryption
opendedup Mar 21, 2022
ee84c07
Merge branch 'master' into dp2
opendedup Mar 21, 2022
1b2fa1c
Merge pull request #137 from opendedup/dp2
opendedup Mar 21, 2022
875c040
backed out changes and set to 15gb
opendedup Mar 26, 2022
2451625
removed stat recording
opendedup Mar 26, 2022
1703952
fixed log4j dependency issue
opendedup May 26, 2022
0f68172
removed erasure encoding and log4j dependencies
opendedup Jun 18, 2022
e681aa3
updated loggers
opendedup Jun 19, 2022
d1438cd
updated loggers
opendedup Jun 19, 2022
297286f
fixed logging
opendedup Jun 19, 2022
ff5bd53
update pom.xml
opendedup Jun 19, 2022
e7e60b5
updated dependencies
opendedup Jun 20, 2022
5ef12d0
fixed s3 errors
opendedup Jun 20, 2022
9c8710a
updated syncdl parameter
opendedup Jun 20, 2022
e235383
updated azure
opendedup Jun 20, 2022
fbb89d6
removed verbose logging
opendedup Jun 23, 2022
d6e1098
fixed appender
opendedup Jun 23, 2022
c65d2d6
updated azure warnings
opendedup Jun 26, 2022
df5858f
added error on change of write
opendedup Jun 26, 2022
3d66c61
added change of immutable for rename
opendedup Jun 26, 2022
ad08ccb
removed immutable stuff
opendedup Jun 27, 2022
7292238
set written to flag
opendedup Jun 27, 2022
6c40477
bugfix changes
opendedup Jun 28, 2022
512182f
added counters
opendedup Jul 7, 2022
c3ab142
made clientside dedup mthreaded
opendedup Jul 7, 2022
7bba1ea
updated dependencies
opendedup Jul 8, 2022
f67aca0
fixed max size calculation
opendedup Jul 9, 2022
9e7f66e
updated java version
opendedup Jul 10, 2022
91a54d8
updated docker version
opendedup Jul 10, 2022
3ac98de
updated start command
opendedup Jul 10, 2022
c6d2167
updated to support compression length
opendedup Jul 12, 2022
2de4271
updated windows setup
opendedup Jul 13, 2022
61814b2
merge changes
opendedup Jul 14, 2022
ec8c1c8
Windows Setup Update
opendedup Jul 19, 2022
fd4474b
Merge branch 'dp3' of https://github.com/opendedup/sdfs into dp3
opendedup Jul 19, 2022
9391ecf
windows setup cleanup
opendedup Jul 21, 2022
81e82cf
cleanup
opendedup Jul 21, 2022
5888bd1
changes made to remove nsis and merge
opendedup Jul 21, 2022
975d494
merge out of branch changes
opendedup Jul 27, 2022
e77e6d6
Fixes to logging
opendedup Jul 29, 2022
cc5e4a0
fixed close error
opendedup Aug 1, 2022
9020370
updated patch and possible upload issues
opendedup Aug 3, 2022
e1a2f69
Merge branch 'master' into dp3
opendedup Aug 4, 2022
3c55756
Merge pull request #141 from opendedup/dp3
opendedup Aug 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-9">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand All @@ -18,9 +18,22 @@
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/resources">
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
Expand All @@ -29,8 +42,8 @@
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="src" path="src"/>
</classpath>
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
/bin/
install-packages/windows/SDFS-2.0.13-Setup.exe
install-packages/windows/bin/jre/
install-packages/windows/wix/
install-packages/SDFS-3.0.1-Setup.exe
windows-exe/*/x64
windows-exe/*/Debug/
windows-exe/*/Release/
windows-exe/*/ipch/
windows-exe/WindowsSetup/WindowsSetup/bin/
windows-exe/WindowsSetup/WindowsSetup/obj/
windows-exe/x64
windows-exe/Debug/
windows-exe/Release/
Expand Down Expand Up @@ -35,3 +38,4 @@ pkgs/*.rpm
pkgs/*.deb
pkgs/*.jar
.project
install-packages/docker run --name sdfs-gcs -e TYPE=GOOGL.sh
2 changes: 1 addition & 1 deletion .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
eclipse.preferences.version=1
encoding//src/resources=UTF-8
encoding//test/java=UTF-8
encoding/<project>=UTF-8
encoding/resources=UTF-8
encoding/src=UTF-8
2 changes: 2 additions & 0 deletions .settings/org.eclipse.jdt.apt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.apt.aptEnabled=false
org.eclipse.jdt.apt.genSrcDir=target\\generated-sources\\annotations
org.eclipse.jdt.apt.genTestSrcDir=target\\generated-test-sources\\test-annotations
28 changes: 11 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,18 @@ COPY src /sdfs-build/src/
COPY .git /sdfs-build/.git
COPY install-packages /sdfs-build/install-packages/
WORKDIR "/sdfs-build"
RUN DEBIAN_FRONTEND="noninteractive" apt update && DEBIAN_FRONTEND="noninteractive" apt upgrade -y && DEBIAN_FRONTEND="noninteractive" apt install -y \
-y nsis
RUN wget https://nsis.sourceforge.io/mediawiki/images/7/7f/EnVar_plugin.zip && \
unzip EnVar_plugin.zip -d /usr/share/nsis/
RUN wget https://nsis.sourceforge.io/mediawiki/images/4/4a/AccessControl.zip && \
unzip AccessControl.zip -d /usr/share/nsis/ && \
cp /usr/share/nsis/Plugins/i386-unicode/AccessControl.dll /usr/share/nsis/Plugins/x86-unicode/
RUN wget https://cdn.azul.com/zulu/bin/zulu11.48.21-ca-jre11.0.11-win_x64.zip && \
rm -rf install-packages/windows/bin/jre && \
unzip zulu11.48.21-ca-jre11.0.11-win_x64.zip -d /tmp/ && \
mv /tmp/zulu11.48.21-ca-jre11.0.11-win_x64 install-packages/windows/bin/jre
RUN DEBIAN_FRONTEND="noninteractive" apt update && DEBIAN_FRONTEND="noninteractive" apt upgrade -y && DEBIAN_FRONTEND="noninteractive"

#RUN wget https://cdn.azul.com/zulu/bin/zulu18.30.11-ca-jdk18.0.1-win_x64.zip && \
# rm -rf install-packages/windows/bin/jre && \
# unzip zulu18.30.11-ca-jdk18.0.1-win_x64.zip -d /tmp/ && \
# mv /tmp/zulu18.30.11-ca-jdk18.0.1-win_x64 install-packages/windows/bin/jre

RUN wget https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz && \
RUN wget https://cdn.azul.com/zulu/bin/zulu18.30.11-ca-jdk18.0.1-linux_x64.tar.gz && \
rm -rf install-packages/deb/usr/share/sdfs/bin/jre && \
tar -xzvf zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz && \
tar -xzvf zulu18.30.11-ca-jdk18.0.1-linux_x64.tar.gz && \
mkdir -p install-packages/deb/usr/share/sdfs/bin/ && \
cp -rf zulu11.35.13-ca-jdk11.0.5-linux_x64 install-packages/deb/usr/share/sdfs/bin/jre
cp -rf zulu18.30.11-ca-jdk18.0.1-linux_x64 install-packages/deb/usr/share/sdfs/bin/jre
RUN DEBIAN_FRONTEND="noninteractive" apt update && DEBIAN_FRONTEND="noninteractive" apt upgrade -y && DEBIAN_FRONTEND="noninteractive" apt install -y \
git
ENV VERSION=master
Expand All @@ -42,7 +37,6 @@ RUN cp target/lib/*.jar install-packages/deb/usr/share/sdfs/lib/ && \
cp target/sdfs-${VERSION}.jar install-packages/deb/usr/share/sdfs/lib/sdfs.jar && \
cp target/sdfs-${VERSION}.jar install-packages
WORKDIR "/sdfs-build/install-packages/windows"
RUN makensis -V4 -DVERSION=${PKG_VERSION} -DJARVERSION=${VERSION} sdfs_win.nsi
WORKDIR "/sdfs-build/install-packages/"
RUN chmod 777 deb/sbin/sdfscli && \
chmod 777 deb/usr/share/sdfs/sdfscli
Expand All @@ -52,9 +46,9 @@ RUN rm -rf *.deb *.rpm && \
fpm -s dir -t deb -n sdfs -v $PKG_VERSION -C deb/ -d fuse --url http://www.opendedup.org -d libxml2 -d libxml2-utils -m [email protected] --vendor datishsystems --description "SDFS is an inline deduplication based filesystem" && \
fpm -s dir -t rpm -n sdfs -v $PKG_VERSION -C deb/ -d fuse --url http://www.opendedup.org -d libxml2 -m [email protected] --vendor datishsystems --description "SDFS is an inline deduplication based filesystem"
WORKDIR "/sdfs-build/install-packages/"
RUN echo "tar cvf - sdfs-${VERSION}.jar sdfs_${PKG_VERSION}_amd64.deb sdfs-${PKG_VERSION}-1.x86_64.rpm SDFS-${PKG_VERSION}-Setup.exe" > export_data.sh && \
RUN echo "tar cvf - sdfs-${VERSION}.jar sdfs_${PKG_VERSION}_amd64.deb sdfs-${PKG_VERSION}-1.x86_64.rpm" > export_data.sh && \
chmod 700 export_data.sh
ENTRYPOINT tar cvf - sdfs-${VERSION}.jar sdfs_${PKG_VERSION}_amd64.deb sdfs-${PKG_VERSION}-1.x86_64.rpm SDFS-${PKG_VERSION}-Setup.exe
ENTRYPOINT tar cvf - sdfs-${VERSION}.jar sdfs_${PKG_VERSION}_amd64.deb sdfs-${PKG_VERSION}-1.x86_64.rpm
FROM ubuntu:20.04
ENV VERSION=master
ENV PKG_VERSION=0.0.1
Expand Down
24 changes: 6 additions & 18 deletions Dockerfile.localbuild
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,12 @@ COPY .git /sdfs-build/.git
COPY install-packages /sdfs-build/install-packages/
WORKDIR "/sdfs-build"
RUN DEBIAN_FRONTEND="noninteractive" apt update && DEBIAN_FRONTEND="noninteractive" apt upgrade -y && DEBIAN_FRONTEND="noninteractive" apt install -y \
-y nsis
RUN wget https://nsis.sourceforge.io/mediawiki/images/7/7f/EnVar_plugin.zip && \
unzip EnVar_plugin.zip -d /usr/share/nsis/
RUN wget https://nsis.sourceforge.io/mediawiki/images/4/4a/AccessControl.zip && \
unzip AccessControl.zip -d /usr/share/nsis/ && \
cp /usr/share/nsis/Plugins/i386-unicode/AccessControl.dll /usr/share/nsis/Plugins/x86-unicode/
RUN wget https://cdn.azul.com/zulu/bin/zulu11.48.21-ca-jre11.0.11-win_x64.zip && \
rm -rf install-packages/windows/bin/jre && \
unzip zulu11.48.21-ca-jre11.0.11-win_x64.zip -d /tmp/ && \
mv /tmp/zulu11.48.21-ca-jre11.0.11-win_x64 install-packages/windows/bin/jre
git
RUN wget https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz && \
rm -rf install-packages/deb/usr/share/sdfs/bin/jre && \
tar -xzvf zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz && \
mkdir -p install-packages/deb/usr/share/sdfs/bin/ && \
cp -rf zulu11.35.13-ca-jdk11.0.5-linux_x64 install-packages/deb/usr/share/sdfs/bin/jre
RUN DEBIAN_FRONTEND="noninteractive" apt update && DEBIAN_FRONTEND="noninteractive" apt upgrade -y && DEBIAN_FRONTEND="noninteractive" apt install -y \
git
ENV VERSION=master
ENV PKG_VERSION=0.0.1
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/
Expand All @@ -69,19 +58,18 @@ RUN mvn package
RUN cp target/lib/*.jar install-packages/deb/usr/share/sdfs/lib/ && \
cp target/sdfs-${VERSION}.jar install-packages/deb/usr/share/sdfs/lib/sdfs.jar && \
cp target/sdfs-${VERSION}.jar install-packages
WORKDIR "/sdfs-build/install-packages/windows"
RUN makensis -V4 -DVERSION=${PKG_VERSION} -DJARVERSION=${VERSION} sdfs_win.nsi
WORKDIR "/sdfs-build/install-packages/"
RUN rm -rf *.deb *.rpm && \
cp ../src/readme.txt deb/usr/share/sdfs/ && \
fpm -s dir -t deb -n sdfs -v $PKG_VERSION -C deb/ -d fuse --url http://www.opendedup.org -d libxml2 -d libxml2-utils -m [email protected] --vendor datishsystems --description "SDFS is an inline deduplication based filesystem" && \
fpm -s dir -t rpm -n sdfs -v $PKG_VERSION -C deb/ -d fuse --url http://www.opendedup.org -d libxml2 -m [email protected] --vendor datishsystems --description "SDFS is an inline deduplication based filesystem"
WORKDIR "/sdfs-build/install-packages/"
RUN echo "tar cvf - sdfs-${VERSION}-jar-with-dependencies.jar sdfs_${PKG_VERSION}_amd64.deb sdfs-${PKG_VERSION}-1.x86_64.rpm SDFS-${PKG_VERSION}-Setup.exe" > export_data.sh && \
RUN echo "tar cvf - sdfs-${VERSION}-jar-with-dependencies.jar sdfs_${PKG_VERSION}_amd64.deb sdfs-${PKG_VERSION}-1.x86_64.rpm" > export_data.sh && \
chmod 700 export_data.sh
ENTRYPOINT tar cvf - sdfs-${VERSION}.jar sdfs_${PKG_VERSION}_amd64.deb sdfs-${PKG_VERSION}-1.x86_64.rpm
FROM ubuntu:20.04
ENV VERSION=master
ENV PKG_VERSION=0.0.1
LABEL [email protected]
LABEL author="Sam Silverberg"
RUN DEBIAN_FRONTEND="noninteractive" apt update && DEBIAN_FRONTEND="noninteractive" apt upgrade -y && DEBIAN_FRONTEND="noninteractive" apt install -y \
Expand All @@ -97,9 +85,9 @@ RUN DEBIAN_FRONTEND="noninteractive" apt update && DEBIAN_FRONTEND="noninteracti
libxml2-utils \
fuse
WORKDIR "/tmp"
COPY --from=builder /sdfs-build/install-packages/sdfs_${VERSION}_amd64.deb .
RUN dpkg -i sdfs_${VERSION}_amd64.deb && \
rm sdfs_${VERSION}_amd64.deb
COPY --from=builder /sdfs-build/install-packages/sdfs_${PKG_VERSION}_amd64.deb .
RUN dpkg -i sdfs_${PKG_VERSION}_amd64.deb && \
rm sdfs_${PKG_VERSION}_amd64.deb
RUN echo "* hard nofile 65535" >> /etc/security/limits.conf
RUN echo "* soft nofile 65535" >> /etc/security/limits.conf
COPY --from=builder /sdfs-build/install-packages/docker_run.sh /usr/share/sdfs/docker_run.sh
Expand Down
180 changes: 180 additions & 0 deletions SDFS_DP_Changes_after_100821_till_071221.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
diff --git a/src/org/opendedup/sdfs/windows/utils/WinRegistry.java b/src/org/opendedup/sdfs/windows/utils/WinRegistry.java
index 8fd690d1..cf1d4d13 100644
--- a/src/org/opendedup/sdfs/windows/utils/WinRegistry.java
+++ b/src/org/opendedup/sdfs/windows/utils/WinRegistry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (C) 2016 Sam Silverberg [email protected]
+ * Copyright (C) 2016 Sam Silverberg [email protected]
*
* This file is part of OpenDedupe SDFS.
*
@@ -21,65 +21,97 @@ package org.opendedup.sdfs.windows.utils;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
+import java.lang.reflect.InvocationTargetException;
+import org.opendedup.logging.SDFSLogger;

-
-public class WinRegistry {
- public static final int HKEY_LOCAL_MACHINE = 0x80000002;
-
+public class WinRegistry {
public static final int KEY_SZ = 0;
public static final int KEY_DWORD = 1;
+ private static final String REG_QUERY = "reg query ";
+ private static final String REG_STR = "REG_SZ";
+ private static final String REG_DWORD = "REG_DWORD";

+ static String readRegistryRegQuery(String key) throws IOException {
+ String useKey = REG_QUERY + key;
+ int keyType = -1;

- public static final String readRegistry(String location, String key){
- try {
- // Run reg query, then read output with StreamReader (internal class)
- Process process = Runtime.getRuntime().exec("reg query " +
- '"'+ location + "\" /v " + key);
+ Process process = Runtime.getRuntime().exec(useKey);
+ StreamReader reader = new StreamReader(process.getInputStream());

- StreamReader reader = new StreamReader(process.getInputStream());
- reader.start();
+ reader.start();
+ try {
process.waitFor();
reader.join();
- String output = reader.getResult();
-
- // Output has the following format:
- // \n<Version information>\n\n<key>\t<registry type>\t<value>
- if( ! output.contains("\t")){
- return null;
- }
+ } catch (InterruptedException e) {
+ SDFSLogger.getLog().error(e.getMessage());
+ Thread.currentThread().interrupt();
+ }

- // Parse out the value
- String[] parsed = output.split("\t");
- return parsed[parsed.length-1];
+ String result = reader.getResult();
+ int p = -1;
+ if (result.contains(REG_STR)) {
+ p = result.indexOf(REG_STR);
+ keyType = KEY_SZ;
+ } else if (result.contains(REG_DWORD)) {
+ p = result.indexOf(REG_DWORD);
+ keyType = KEY_DWORD;
}
- catch (Exception e) {
+
+ if (p == -1) {
return null;
}

+ switch (keyType) {
+ case KEY_SZ:
+ return result.substring(p + REG_STR.length()).trim();
+ case KEY_DWORD:
+ String temp = result.substring(p + REG_DWORD.length()).trim();
+ return Integer.toString((Integer.parseInt(temp.substring("0x".length()), 16)));
+ default:
+ return "";
+ }
}

static class StreamReader extends Thread {
- private InputStream is;
- private StringWriter sw= new StringWriter();
+ private final InputStream mIs;
+
+ private final StringWriter mSw;

- public StreamReader(InputStream is) {
- this.is = is;
+ StreamReader(InputStream is) {
+ mIs = is;
+ mSw = new StringWriter();
}

+ @Override
public void run() {
+ int c;
try {
- int c;
- while ((c = is.read()) != -1)
- sw.write(c);
+ while ((c = mIs.read()) != -1) {
+ mSw.write(c);
+ }
+ } catch (IOException e) {
+ SDFSLogger.getLog().error(e.getMessage());
}
- catch (IOException e) {
- }
+
}

- public String getResult() {
- return sw.toString();
+ String getResult() {
+ return mSw.toString();
}
}

+ public static String readRegistry(String location, String key) throws IOException {
+ String pathkey = "\"" +
+ location +
+ "\" /v " +
+ key;
+ return readRegistryRegQuery(pathkey);
+ }

+ public static void main(String[] args) throws IllegalArgumentException,
+ IllegalAccessException, InvocationTargetException {
+ //System.out.println(WinRegistry.readString(HKEY_LOCAL_MACHINE,
+ // "SOFTWARE\\Wow6432Node\\SDFS", "path"));
+ System.out.println("Running Winregistry class");
+ }
}
diff --git a/src/org/opendedup/util/OSValidator.java b/src/org/opendedup/util/OSValidator.java
index 4a82c493..d83ca3b3 100644
--- a/src/org/opendedup/util/OSValidator.java
+++ b/src/org/opendedup/util/OSValidator.java
@@ -67,13 +67,13 @@ public class OSValidator {
}

public static String getProgramBasePath() {
- if (isUnix() || isMac())
- if(Main.sdfsBasePath.equals("")) {
- return "/opt/sdfs/";
- } else {
- return Main.sdfsBasePath;
- }
- else {
+ if (isUnix() || isMac()) {
+ if(Main.sdfsBasePath.equals("")) {
+ return "/opt/sdfs/";
+ } else {
+ return Main.sdfsBasePath;
+ }
+ } else {
try {
return WinRegistry.readRegistry(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\SDFS", "path") + File.separator;
@@ -85,9 +85,9 @@ public class OSValidator {
}

public static String getConfigPath() {
- if (isUnix() || isMac())
- return "/etc/sdfs/";
- else
+ if (isUnix() || isMac()) {
+ return Main.sdfsBasePath + "/etc/sdfs/";
+ } else
try {
return WinRegistry.readRegistry(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\SDFS", "path")
6 changes: 3 additions & 3 deletions install-packages/deb/sbin/startsdfs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ EXEC="/usr/share/sdfs/jsvc"
BASEPATH="/usr/share/sdfs"
PF="sdfs-ncfg.pid"
OPTIND=1
while getopts "v:z:f:p:e:anmzcdshcrl" opt; do
while getopts "v:z:f:p:e:b:t:w:q:anmzcdshcrl" opt; do
case $opt in
v)
CFG="/etc/sdfs/$OPTARG-volume-cfg.xml"
Expand Down Expand Up @@ -45,7 +45,7 @@ else
MEMORY=$MEM
fi

LD_PRELOAD="${BASEPATH}/bin/libfuse.so.2" $EXEC -server -outfile '&1' -errfile '&2' -Djava.library.path=${BASEPATH}/bin/ -home ${BASEPATH}/bin/jre -Dorg.apache.commons.logging.Log=fuse.logging.FuseLog -Xss2m \
$EXEC -server -outfile '&1' -errfile '&2' -Djava.library.path=${BASEPATH}/bin/ -home ${BASEPATH}/bin/jre -Dorg.apache.commons.logging.Log=fuse.logging.FuseLog -Xss2m \
-wait 99999999999 -Dfuse.logging.level=INFO -Dfile.encoding=UTF-8 ${DOCKER_DETATCH} -Xmx$MEMORY$MU -Xms$MEMORY$MU \
-XX:+DisableExplicitGC -pidfile /var/run/$PF -XX:+UseG1GC -Djava.awt.headless=true \
-XX:+DisableExplicitGC ${JAVA_EXT_CMD} -pidfile /var/run/$PF -XX:+UseG1GC -Djava.awt.headless=true \
-cp ${BASEPATH}/lib/sdfs.jar:${BASEPATH}/lib/* fuse.SDFS.MountSDFS "$@"
Loading