~xdavidwu/saf-cephfs

0d9d480e1eb6f4bef4bdce650242ed7389cdad20 — xdavidwu 3 years ago 2df2e03
DocumentsProvider: setup ceph only when needed
1 files changed, 4 insertions(+), 2 deletions(-)

M src/main/java/org/safcephfs/CephFSDocumentsProvider.java
M src/main/java/org/safcephfs/CephFSDocumentsProvider.java => src/main/java/org/safcephfs/CephFSDocumentsProvider.java +4 -2
@@ 34,7 34,7 @@ public class CephFSDocumentsProvider extends DocumentsProvider {
	private String id, mon, path, key;
	private StorageManager sm;
	private Handler ioHandler;
	private CephMount cm;
	private CephMount cm = null;
	private int uid;
	private ToastThread lthread;



@@ 113,6 113,9 @@ public class CephFSDocumentsProvider extends DocumentsProvider {
	}

	private <T> T doCephOperation(CephOperation<T> op) {
		if (cm == null) {
			setupCeph();
		}
		int r = retries;
		while (r-- != 0) {
			try {


@@ 181,7 184,6 @@ public class CephFSDocumentsProvider extends DocumentsProvider {
		ioThread.start();
		ioHandler = new Handler(ioThread.getLooper());
		uid = Process.myUid();
		setupCeph();
		return true;
	}