Page tree
Skip to end of metadata
Go to start of metadata

Running HelloREEF with no client

The difference between HelloREEF and HelloREEFNoClient

 The HelloREEF application has multiple versions that all service different needs; one of these applications, HelloREEFNoClient, allows the creation of the Driver and Evaluators without a Client. In many scenarios involving a cluster of machines one Client will access multiple Drivers, so not every Driver needs to create a Client and that is where the HelloREEFNoClient application shines.

Running HelloREEFNoClient is nearly identical to running HelloREEF:


> java -cp lang/java/reef-examples/target/reef-examples-{$REEF_VERSION}-shaded.jar org.apache.reef.examples.hello.HelloREEFNoClient

The output should be the same to HelloREEF, with evaluator.stdout containing the “Hello, REEF!” message.


Running HelloREEF on YARN

REEF applications can be run on multiple runtime environments. Using HelloREEFYarn, we will see how to configure and launch REEF applications on YARN.


You have compiled REEF locally, and have YARN installed and correctly configured.

How to configure REEF on YARN

The only difference between running a REEF application on YARN vs locally is the runtime configuration:

final LauncherStatus status = DriverLauncher
        .run(getDriverConfiguration(), JOB_TIMEOUT);

How to launch HelloREEFYarn

Running HelloREEFYarn is very similar to running HelloREEF:

> yarn jar lang/java/reef-examples/target/reef-examples-{$REEF_VERSION}-shaded.jar org.apache.reef.examples.hello.HelloREEFYarn

You can see how REEF applications work on YARN environments in Introduction to REEF.


Running a REEF Webserver: HelloREEFHttp

REEF also has a webserver interface to handle HTTP requests. This webserver can be utilized in many different manners such as in Interprocess Communcation or in conjuction with the REST API.

To demonstrate a possible use for this interface, HelloREEFHttp serves as a simple webserver to execute shell commands requested from user input. The first thing we should do is register a handler to receive the HTTP requests.


Again, you have compiled REEF locally.



HttpServerShellCmdHandler implements HttpHandler but three methods must be overridden first: getUriSpecification, setUriSpecification, and onHttpRequest.

  •  UriSpecification defines the URI specification for the handler. More than one handler can exist per application and thus each handler is distinguished using this specification. Since HelloREEFHttp defines UriSpecification asCommand, an HTTP request looks like http://{host_address}:{host_port}/Command/{request}.
  • onHttpRequest defines a hook for when an HTTP request for this handler is invoked.
  • No labels