diff options
10 files changed, 15 insertions, 156 deletions
diff --git a/config-proxy/pom.xml b/config-proxy/pom.xml index 13e2ddf40e8..8a7b6f253e2 100644 --- a/config-proxy/pom.xml +++ b/config-proxy/pom.xml @@ -57,15 +57,10 @@ <artifactId>hamcrest-core</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - </dependency> - <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>filedistribution</artifactId> - <version>${project.version}</version> - </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + </dependency> </dependencies> <build> <plugins> diff --git a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java index 28bcca9db13..173d2b8a43a 100644 --- a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java +++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java @@ -13,8 +13,8 @@ import com.yahoo.log.event.Event; import com.yahoo.system.CatchSigTerm; import com.yahoo.vespa.config.*; import com.yahoo.vespa.config.protocol.JRTServerConfigRequest; -import com.yahoo.vespa.filedistribution.FileDistributionRpcServer; -import com.yahoo.vespa.filedistribution.FileDownloader; +import com.yahoo.vespa.config.proxy.filedistribution.FileDistributionRpcServer; +import com.yahoo.vespa.config.proxy.filedistribution.FileDownloader; import java.util.List; import java.util.concurrent.Executors; diff --git a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileDistributionRpcServer.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileDistributionRpcServer.java index d09cf17b9e3..b0fbc7acd33 100644 --- a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileDistributionRpcServer.java +++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileDistributionRpcServer.java @@ -1,5 +1,5 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.filedistribution; +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.config.proxy.filedistribution; import com.yahoo.config.FileReference; import com.yahoo.jrt.DoubleArray; diff --git a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileDownloader.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileDownloader.java index cd4b3afb9b5..ac7555c7905 100644 --- a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileDownloader.java +++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileDownloader.java @@ -1,5 +1,5 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.filedistribution; +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.config.proxy.filedistribution; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; diff --git a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReceiver.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileReceiver.java index 3999389d2c7..e9631c445df 100644 --- a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReceiver.java +++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileReceiver.java @@ -1,6 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.filedistribution; +package com.yahoo.vespa.config.proxy.filedistribution; import com.yahoo.config.FileReference; import com.yahoo.jrt.Int32Value; diff --git a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownload.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileReferenceDownload.java index fb511411128..ce5a30dc7ad 100644 --- a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownload.java +++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileReferenceDownload.java @@ -1,6 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.filedistribution; +package com.yahoo.vespa.config.proxy.filedistribution; import com.google.common.util.concurrent.SettableFuture; import com.yahoo.config.FileReference; diff --git a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileReferenceDownloader.java index fbadddd624a..c972cfbbf56 100644 --- a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java +++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileReferenceDownloader.java @@ -1,5 +1,5 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.filedistribution; +package com.yahoo.vespa.config.proxy.filedistribution; import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.ListenableFuture; diff --git a/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java b/config-proxy/src/test/java/com/yahoo/vespa/config/proxy/filedistribution/FileDownloaderTest.java index 738b0888956..d1b691b9d5e 100644 --- a/filedistribution/src/test/java/com/yahoo/vespa/filedistribution/FileDownloaderTest.java +++ b/config-proxy/src/test/java/com/yahoo/vespa/config/proxy/filedistribution/FileDownloaderTest.java @@ -1,6 +1,4 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -package com.yahoo.vespa.filedistribution; +package com.yahoo.vespa.config.proxy.filedistribution; import com.yahoo.config.FileReference; import com.yahoo.io.IOUtils; diff --git a/filedistribution/pom.xml b/filedistribution/pom.xml index 288b641134f..e63b85a22b8 100644 --- a/filedistribution/pom.xml +++ b/filedistribution/pom.xml @@ -4,43 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <dependencies> - <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>config-lib</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>vespajlib</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>jrt</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>vespalog</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>com.yahoo.vespa</groupId> - <artifactId>config</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - <parent> + <parent> <groupId>com.yahoo.vespa</groupId> <artifactId>parent</artifactId> <version>6-SNAPSHOT</version> diff --git a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/RpcTester.java b/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/RpcTester.java deleted file mode 100644 index 28935c203fe..00000000000 --- a/filedistribution/src/main/java/com/yahoo/vespa/filedistribution/RpcTester.java +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -package com.yahoo.vespa.filedistribution; - -import com.yahoo.config.FileReference; -import com.yahoo.io.IOUtils; -import com.yahoo.jrt.DataValue; -import com.yahoo.jrt.Int32Value; -import com.yahoo.jrt.Int64Value; -import com.yahoo.jrt.Request; -import com.yahoo.jrt.Spec; -import com.yahoo.jrt.StringValue; -import com.yahoo.jrt.Supervisor; -import com.yahoo.jrt.Target; -import com.yahoo.jrt.Transport; -import com.yahoo.log.LogLevel; -import net.jpountz.xxhash.XXHash64; -import net.jpountz.xxhash.XXHashFactory; - -import java.io.File; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.logging.Logger; - -public class RpcTester { - - private static final Logger log = Logger.getLogger(RpcTester.class.getName()); - - private final Target target; - - private RpcTester(Target target) { - this.target = target; - } - - private void call(String fileReference, String filename, byte[] blob) { - new FileReceiver(target).receive(new FileReference(fileReference), filename, blob); - } - - public static void main(String[] args) { - //String fileReference = args[0]; - String fileReference = "59f93f445438c9db7ccbf1629f583c2aa004a68b"; - String filename = "com.yahoo.vespatest.ExtraHitSearcher-1.0.0-deploy.jar"; - File file = new File(String.format("/tmp/%s/%s", fileReference, filename)); - byte[] blob = null; - - try { - blob = IOUtils.readFileBytes(file); - } catch (IOException e) { - e.printStackTrace(); - } - - log.log(LogLevel.INFO, "Read blob from " + file.getAbsolutePath()); - - - Supervisor supervisor = new Supervisor(new Transport()); - - Spec spec = new Spec("tcp/localhost:19090"); - log.log(LogLevel.INFO, "Connecting to " + spec); - Target target = supervisor.connect(spec); - if (! target.isValid()) { - log.log(LogLevel.INFO, "Could not connect"); - System.exit(1); - } else { - log.log(LogLevel.INFO, "Connected to " + spec); - } - - new RpcTester(target).call(fileReference, filename, blob); - } - - class FileReceiver { - - Target target; - - FileReceiver(Target target) { - this.target = target; - } - - void receive(FileReference reference, String filename, byte[] content) { - - log.log(LogLevel.INFO, "Preparing receive call for " + reference.value() + " and file " + filename); - - XXHash64 hasher = XXHashFactory.fastestInstance().hash64(); - Request fileBlob = new Request("filedistribution.receiveFile"); - - log.log(LogLevel.INFO, "Calling " + fileBlob.methodName() + " with target " + target); - - fileBlob.parameters().add(new StringValue(reference.value())); - fileBlob.parameters().add(new StringValue(filename)); - fileBlob.parameters().add(new DataValue(content)); - fileBlob.parameters().add(new Int64Value(hasher.hash(ByteBuffer.wrap(content), 0))); - fileBlob.parameters().add(new Int32Value(0)); - fileBlob.parameters().add(new StringValue("OK")); - log.log(LogLevel.INFO, "Doing invokeSync"); - target.invokeSync(fileBlob, 5); - log.log(LogLevel.INFO, "Done with invokeSync"); - } - } -} |