Tutorial (v0.3)

From Native Big Data Documentation
Jump to: navigation, search


NBD tutorial

Installation

  • Download nbd in zip format from http://download.nativebigdata.com
  • Unzip your zip file in a folder. NBD will only write in this folder. This means that you must choose a folder with enougth space to store the data that you will need.

Several versions can be installed in different folders but only one version od NBD must be running in your network.

  • Be sure your machine has the computer name you want. A urp will be assigned to every computer. The urp will be in the form urp:server:/<name of computer>

Launch NBD

  • run nbd.bat

Launch the gui intarfece

  • Open "http://127.0.0.1/8888/nbd/index.html" in Firefox or Chrome in a machine with nbd running.
  • Select the server you want to use as a resolver. Only one machine can be the NBD resolver. The resolver machine will be the server that will help to say where are stored the distributed resources.

File:Select resolver.png

Write a op program

  • Pick in the "Reosource editor" button,
  • Press in the ">_" button.
  • Write the code in the Edit window
  • Press the test/run button to execute the code.
  • The result of the op program will be displayed in the 'Output window'.

File:Editor.png

Examples of code

  • Hello world
(() => {"Hello World"}) ()
  • Mathematical operations
var f = ( (a,b) => { a+b } );f(3,5)
  • Creating a persistent object
var a = new ( "urp:obj:/tt" , [1,2,3,4,5,6] ,1 ); "OK"
  • Operating with the created object

Retrieve the object

var a = i2r("urp:obj:/tt");a

Retrieve the object multiplied by 2

var a = i2r("urp:obj:/tt");a*2

Load the object in RAM to improve speed

var a = i2rr("urp:obj:/tt");a

Load the object in RAM in other server to improve speed in the other server

var = @( "urp:server:/other_server",	
	i2rr("urp:obj:/tt")); a

Searching urp's

Urp's and urn's can be found using the search options of the gui interface.

File:Intro.png

  • First select the scope of the urp to search. Global scope is the scope of all the NBD network. Searching urp's in other scopes is only needed by administrators.
  • Write the text you want look for , or none to list all urn's and urp's in the network
  • Press the search button.

File:Results.png