[forwarding to user@]
Hi Chaitanya
From a quick look at the stacktrace, it looks like you have conflicting
versions of Google's Guava library on your classpath. Could you check
(using the Maven dependency:tree goal [1], for example) which version
you are using?
Regards
ap
[1] https://maven.apache.org/plugins/maven-dependency-plugin/
On 2017-03-21 11:40, Chaitanya Anumalasetty wrote:
--------------------------------------------------------------------------
jclouds Version :
<artifactId>jclouds-all</artifactId>
<version>2.0.0</version>
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Cloud and API Version : filesystem
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Operating System Version : CentOS-x86_64 x86_64 GNU/Linux
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Java Version :
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Apache Spark version :
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>2.0.2</version>
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Logs :
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.spark.deploy.worker.DriverWrapper$.main(DriverWrapper.scala:58)
at
org.apache.spark.deploy.worker.DriverWrapper.main(DriverWrapper.scala)
Caused by: java.lang.NoSuchMethodError:
com.google.common.hash.HashCode.fromBytes([B)Lcom/google/common/hash/HashCode;
at
org.jclouds.filesystem.strategy.internal.FilesystemStorageStrategyImpl.getBlob(FilesystemStorageStrategyImpl.java:360)
at
org.jclouds.blobstore.config.LocalBlobStore.loadBlob(LocalBlobStore.java:458)
at
org.jclouds.blobstore.config.LocalBlobStore.access$100(LocalBlobStore.java:103)
at
org.jclouds.blobstore.config.LocalBlobStore$2.apply(LocalBlobStore.java:253)
at
org.jclouds.blobstore.config.LocalBlobStore$2.apply(LocalBlobStore.java:250)
at
com.google.common.collect.Iterators$8.transform(Iterators.java:860)
at
com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
at
com.google.common.collect.Iterators$7.computeNext(Iterators.java:701)
at
com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
at
com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
at com.google.common.collect.Sets.newTreeSet(Sets.java:334)
at
org.jclouds.blobstore.config.LocalBlobStore.list(LocalBlobStore.java:249)
at
org.jclouds.blobstore.config.LocalBlobStore.list(LocalBlobStore.java:143)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
at com.sun.proxy.$Proxy47.list(Unknown Source)
at
com.arkone.checker.v1.IntegrityChecker.getMetaData(IntegrityChecker.java:262)
at
com.arkone.checker.v1.IntegrityChecker.runIntegrityChecker(IntegrityChecker.java:106)
at
com.arkone.checker.v1.IntegrityChecker.main(IntegrityChecker.java:87)
... 6 more
17/03/21 11:17:28 INFO spark.SparkContext: Invoking stop() from
shutdown hook
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Code :
String filePath =
"file:///home/accure/Desktop/arkone/arkone-data/84ea03b2-7753-42a9-8786-1ac0bd8d307b/2017-03-21-07-04-33";
filePath = filePath.replace("file:", "");
Blob blob = null;
//Identify container name from file path last word
String[] filPath = filePath.split("/");
String containerName = filPath[filPath.length - 1];
System.out.println("containerName-" + containerName);
//Set base directory
Properties overrides = new Properties();
filePath = filePath.substring(0,
filePath.lastIndexOf("/"));
overrides.setProperty(FilesystemConstants.PROPERTY_BASEDIR, filePath);
System.out.println("parsed filePath-" + filePath);
//Initialize the BlobStoreContext
BlobStoreContext context =
ContextBuilder.newBuilder(new
FilesystemApiMetadata()).overrides(overrides).buildView(BlobStoreContext.class);
System.out.println("context-" + context);
//Access the BlobStore
BlobStore blobStore = context.getBlobStore();
System.out.println("blobStore-" + blobStore);
try {
System.out.println("blobStore2-" +
blobStore.countBlobs(containerName));
System.out.println("blobStore4-" +
blobStore.list(containerName));
//Read meta data blob from container
for (StorageMetadata resourceMd :
blobStore.list(containerName)) {
blob = blobStore.getBlob(containerName,
resourceMd.getName());
break;
}
}
} catch (Exception ex) {
StringWriter stack = new StringWriter();
ex.printStackTrace(new PrintWriter(stack));
System.out.println(stack.toString());
}
if (blob != null) {
// Get Blob payload
Payload pl = blob.getPayload();
inStream = pl.openStream();
String data = CharStreams.toString(new InputStreamReader(inStream,
Charsets.UTF_8));
System.out.println(data);
}
overrides = null;
context.close();
}
--------------------------------------------------------------------------
THANKS & REGARDS
A.CHAITANYA
08861409280