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:

 

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.


Prerequisites

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:

How to launch HelloREEFYarn

Running HelloREEFYarn is very similar to running HelloREEF:

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.

Prerequisites

Again, you have compiled REEF locally.

 

HttpServerShellCmdHandler

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