Class Emulator
- java.lang.Object
-
- com.google.cloud.bigtable.emulator.v2.Emulator
-
@BetaApi("Surface for Bigtable emulator is not yet stable") public class Emulator extends Object
Wraps the Bigtable emulator in a java api and decorates it with grpc channel builders.This class will use the golang binaries embedded in this jar to launch the emulator as an external process and redirect its output to a
Logger
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Emulator
createBundled()
Create a new instance of emulator.static Emulator
createFromPath(Path path)
io.grpc.ManagedChannel
getAdminChannel()
io.grpc.ManagedChannel
getDataChannel()
int
getPort()
void
start()
Starts the emulator process and waits for it to be ready.void
stop()
Stops the emulator process.
-
-
-
Method Detail
-
createBundled
public static Emulator createBundled() throws IOException
Create a new instance of emulator. The emulator will use the bundled binaries in this jar. Please note that the emulator is created in a stopped state, please usestart()
after creating it.- Throws:
IOException
-
start
public void start() throws IOException, TimeoutException, InterruptedException
Starts the emulator process and waits for it to be ready.
-
stop
public void stop()
Stops the emulator process.
-
getPort
public int getPort()
-
getDataChannel
public io.grpc.ManagedChannel getDataChannel()
-
getAdminChannel
public io.grpc.ManagedChannel getAdminChannel()
-
-