public class StreamUtils
extends java.lang.Object
修飾子と型 | フィールドと説明 |
---|---|
static java.lang.String | TMP_DIR |
コンストラクターと説明 |
---|
StreamUtils() |
修飾子と型 | メソッドと説明 |
---|---|
static void | appendToRemoteFile(java.lang.String privateKey, java.lang.String host, java.lang.String dir, java.lang.String fileName, java.lang.String payload) リモート EC2 インスタンス上の既存のファイルにペイロードを追加します。 |
static void | copyFileToRemote(java.lang.String privateKey, java.lang.String host, java.net.URI uri, java.io.File file, long waitTime) テストマシンから リモートマシンにファイルをコピーします。 |
static boolean | createDataFileOnRemote(java.lang.String privateKey, java.lang.String host, java.lang.String dir, java.lang.String fileName, java.lang.String payload, int retryTime) ペイロードをコンテンツとして リモート EC2 マシン上にファイルを作成します。 |
static boolean | createRemoteDirectory(java.lang.String path, java.lang.String host, java.lang.String privateKey, int waitTime) リモートマシン上にディレクトリを作成します。 |
static void | destroyAllStreams(java.net.URL adminServer) クラスターからすべてのストリームを削除します。 |
static boolean | fileExists(java.lang.String host, java.lang.String privateKey, java.lang.String path) 指定されたパスが リモートマシン上に存在することを確認します。 |
static java.util.Map<java.lang.String,java.lang.String> | getAvailableContainers(java.net.URL adminServer) コンテナー ID と関連付けられたホストのマップを作成します。 |
static java.lang.Integer[] | getContainerPidsFromURL(java.net.URL url, java.lang.String privateKey, java.lang.String jpsCommand) リモートマシンのコンテナー PID を取得します。 |
static long | getCount(java.net.URL adminServer, java.lang.String name) カウンターの値を取得します |
static java.util.List<org.jclouds.ec2.domain.RunningInstance> | getEC2RunningInstances(java.lang.String awsAccessKey, java.lang.String awsSecretKey, java.lang.String awsRegion) 指定された ec2 リージョンのアクティブなインスタンスのリストを返します。 |
static java.lang.Integer[] | getLocalContainerPids(java.lang.String jpsCommand) ローカルマシン上のコンテナー PID を取得します。 |
static org.springframework.hateoas.PagedResources<ModuleMetadataResource> | getRuntimeModules(java.net.URL adminServer) モジュールがデプロイされているコンテナー ID のリストを返します |
static java.lang.String | httpGet(java.net.URL url) クライアントに対して http get を実行し、結果を文字列として返します。 |
static boolean | isStreamDeployed(java.lang.String streamName, java.net.URL adminServer) 指定されたストリームが XD クラスターにデプロイされているかどうかを確認します。 |
static java.net.URL | replacePort(java.net.URL url, int port) URL に関連付けられたポートを別のポートに置き換えます。 |
static void | stream(java.lang.String streamName, java.lang.String streamDefinition, java.net.URL adminServer) ストリーム定義を作成し、テスト対象のクラスターにデプロイします。 |
static java.lang.String | transferResultsToLocal(java.lang.String privateKey, java.net.URL url, java.lang.String fileName) 指定されたファイルを リモートマシンからローカルマシンにコピーします。 |
static void | undeployStream(java.net.URL adminServer, java.lang.String streamName) 指定されたストリーム名をアンデプロイします |
static boolean | waitForMetric(java.lang.String name, java.net.URL adminServer, int waitTime) メトリクスが作成されるまで待機時間まで待機します。 |
static boolean | waitForStreamDeployment(java.lang.String streamName, java.net.URL adminServer, int waitTime) ストリームがデプロイされるまで待機時間まで待機します。 |
public static final java.lang.String TMP_DIR
public static void stream(java.lang.String streamName, java.lang.String streamDefinition, java.net.URL adminServer)
streamName
- ストリームの名前 streamDefinition
- このストリームにデプロイする必要がある定義。adminServer
- このストリームがデプロイされる管理サーバー。public static java.lang.String httpGet(java.net.URL url)
url
- 取得を実行する場所。public static void destroyAllStreams(java.net.URL adminServer)
adminServer
- コマンドが実行される管理サーバー。public static void undeployStream(java.net.URL adminServer, java.lang.String streamName)
adminServer
- コマンドが実行される管理サーバー。streamName
- The name of the stream to undeploypublic static long getCount(java.net.URL adminServer, java.lang.String name)
adminServer
- the admin server for the cluster being tested.name
- the name of the counter in the metric repo.public static java.lang.String transferResultsToLocal(java.lang.String privateKey, java.net.URL url, java.lang.String fileName)
privateKey
- the ssh private key to the remote machineurl
- The remote machine's url.fileName
- The fully qualified file name of the file to be transferred.public static boolean createDataFileOnRemote(java.lang.String privateKey, java.lang.String host, java.lang.String dir, java.lang.String fileName, java.lang.String payload, int retryTime)
privateKey
- The ssh private key for the remote containerhost
- The remote machine's ip.dir
- The directory to write the filefileName
- The fully qualified file name of the file to be created.payload
- the data to write to the fileretryTime
- the time in millis to retry to push data file to remote system.public static void copyFileToRemote(java.lang.String privateKey, java.lang.String host, java.net.URI uri, java.io.File file, long waitTime)
privateKey
- The ssh private key for the remote containerhost
- The remote machine's ip.uri
- to the location where the file will be copied to remote machine.file
- The file to migrate to remote machine.public static boolean createRemoteDirectory(java.lang.String path, java.lang.String host, java.lang.String privateKey, int waitTime)
path
- the directory that will be createdhost
- the IP where the directory will be createdprivateKey
- Private key to be used for signing onto remote machine.waitTime
- The max time to try creating the directorypublic static void appendToRemoteFile(java.lang.String privateKey, java.lang.String host, java.lang.String dir, java.lang.String fileName, java.lang.String payload)
privateKey
- The ssh private key for the remote containerhost
- The remote machine's ip.dir
- The directory to write the filefileName
- The fully qualified file name of the file to be created.payload
- the data to append to the filepublic static java.util.List<org.jclouds.ec2.domain.RunningInstance> getEC2RunningInstances(java.lang.String awsAccessKey, java.lang.String awsSecretKey, java.lang.String awsRegion)
awsAccessKey
- the unique id of the ec2 user.awsSecretKey
- the password of ec2 user.awsRegion
- The aws region to inspect for acceptance test instances.public static java.net.URL replacePort(java.net.URL url, int port)
url
- The URL that needs a port replaced.port
- The new port numberpublic static java.util.Map<java.lang.String,java.lang.String> getAvailableContainers(java.net.URL adminServer)
adminServer
- The admin server to be queried.public static org.springframework.hateoas.PagedResources<ModuleMetadataResource> getRuntimeModules(java.net.URL adminServer)
adminServer
- The admin server that will be queried.public static boolean waitForStreamDeployment(java.lang.String streamName, java.net.URL adminServer, int waitTime)
streamName
- The name of the stream to be evaluated.adminServer
- The admin server URL that will be queried.waitTime
- the amount of time in millis to wait.public static boolean isStreamDeployed(java.lang.String streamName, java.net.URL adminServer)
streamName
- The name of the stream to be evaluated.adminServer
- The admin server URL that will be queried.public static boolean waitForMetric(java.lang.String name, java.net.URL adminServer, int waitTime)
name
- The name of the metric to be evaluated.adminServer
- The admin server URL that will be queried.waitTime
- the amount of time in millis to wait.public static java.lang.Integer[] getLocalContainerPids(java.lang.String jpsCommand)
jpsCommand
- jps command that will reveal the pids.public static java.lang.Integer[] getContainerPidsFromURL(java.net.URL url, java.lang.String privateKey, java.lang.String jpsCommand)
url
- The URL where the containers are deployed.privateKey
- ssh private key credentialjpsCommand
- The command to retrieve java processes on container machine.public static boolean fileExists(java.lang.String host, java.lang.String privateKey, java.lang.String path)
host
- The host where the file exists.privateKey
- ssh private key credentialpath
- path to file or directory