{"id":25815785,"url":"https://github.com/bikash/r2time","last_synced_at":"2025-07-25T16:09:39.234Z","repository":{"id":14281570,"uuid":"16989627","full_name":"bikash/R2Time","owner":"bikash","description":"R connector for OpenTSDB: Analyzing large time-series data in R environment using data-intensive capabilities. ","archived":false,"fork":false,"pushed_at":"2016-05-03T09:04:32.000Z","size":63319,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T17:53:08.732Z","etag":null,"topics":["hbase","mapreduce","opentsdb","timeseries"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bikash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-19T15:56:24.000Z","updated_at":"2021-03-26T09:03:19.000Z","dependencies_parsed_at":"2022-09-07T17:52:00.145Z","dependency_job_id":null,"html_url":"https://github.com/bikash/R2Time","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bikash/R2Time","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bikash%2FR2Time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bikash%2FR2Time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bikash%2FR2Time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bikash%2FR2Time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bikash","download_url":"https://codeload.github.com/bikash/R2Time/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bikash%2FR2Time/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267029422,"owners_count":24024202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hbase","mapreduce","opentsdb","timeseries"],"created_at":"2025-02-28T04:37:17.948Z","updated_at":"2025-07-25T16:09:39.210Z","avatar_url":"https://github.com/bikash.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"R2Time connector for R to Hbase for time-series data stored by OpenTSDB.  \nAnalyzing time-series datasets at a massive scale is one of the biggest challenges that data scientists are facing.\n This implementation of a tool is used for analyzing large time-series data.\n It describes a way to analyze the data stored by OpenTSDB. OpenTSDB is an open\n source distributed and scalable time series database. \n Currently tools available for time-series analysis are time and memory consuming.\n Moreover, no single tool exists that specializes on providing an efficient implementations\n of analyzing time-series data through MapReduce programming model at massive\n scale. For these reason, we have designed an efficient and distributed computing\n framework - R2Time. \n \n###Implementation for R2Time:###\n```\nMaster Thesis: \nhttp://brage.bibsys.no/xmlui/handle/11250/181819\n\nPublished Paper CloudCom 2014:\nhttp://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=7037792\n```\n\n##Prerequisite Installation for R2Time.##\n1. RHIPE\nInstallation steps are mention in the following link:\nhttps://www.datadr.org/install.html\n\n2. OpenTSDB\nInstallation steps are mention in the following link:\nhttp://opentsdb.net/docs/build/html/installation.html#id1\n\nCheck OpenTSDB is runing successfully.\n```\nhttp://127.0.0.1:4242\n```\n\n##Installation of R2Time.##\n```\n1. $ git clone https://github.com/bikash/R2Time.git\n2. $ cd R2Time\n3. $ R CMD INSTALL r2time_1.0.tar.gz\n```\n\nTo run R2Time it is necessary to have r2time.jar, hbase.jar, zookeeper.jar, asynchbase.jar to your HDFS location. Using rhput command from RHIPE, we can copy to HDFS location.\n```\n$ R\n\u003e library(RHIPE)\n\u003e rhinit()\n\u003e rhput(\"src_location_hbase_jar\", \"hdfs_location\")\n\u003e rhput(\"src_location_zookeeper_jar\", \"hdfs_location\")\n\u003e rhput(\"src_location_r2time_jar\", \"hdfs_location\")\n\u003e rhput(\"src_location_asynchbase_jar\", \"hdfs_location\")\n```\n\nR2time.jar can be downloaded from GitHUB\n\n###Example:###\nNow running simple count example in R2Time.\n\n```\n#Load all the necessary libraries\nlibrary(r2time)\nlibrary(Rhipe)\nrhinit()\t## Initialize rhipe framework.\nlibrary(rJava)\nr2t.init()  ## Initialize R2Time  framework.\nlibrary(bitops) ## Load library for bits operation, It is used for conversion between float and integer numbers.\nlibrary(gtools)\n\n\ntagk = c(\"host\") ## Tag keys. It could be list\ntagv = c(\"*\")\t## Tag values. It could be list or can be separate multiple by pipe\nmetric = 'r2time.load.test1' ## Assign multiple metrics\nstartdate ='2000/01/01-00:00:00' ## Start datetime of timeseries\nenddate =\"2003/01/31-10:00:00\"   ## END datetime of timeseries\noutputdir = \"/home/bikash/tmp/mean/ex1.1\" ## Output file location , should be in HDFS file system.\njobname= \"Calculation for number of DP for 75 million Data points with 2 node\" ## Assign relevant job description name.\nmapred \u003c- list(mapred.reduce.tasks=0) ## Mapreduce configuration, you can assign number of mapper and reducer for a task. For this case is 0, no reducer is required.\n#Location of jar file in HDFS file system. Replace \"/home/ekstern/haisen/bikash/tmp/r2time.jar\" with your required hdfs_location of jar files.\njars=c(\"/home/ekstern/haisen/bikash/tmp/r2time.jar\",\"/home/ekstern/haisen/bikash/tmp/zookeeper.jar\", \"/home/ekstern/haisen/bikash/tmp/hbase.jar\")\n# This jars need to be in HDFS file system. You can copy jar in HDFS using RHIPE rhput command\n \n## Assign Zookeeper configuration. For HBase to read data, zookeeper quorum must be define.\nzooinfo=list(zookeeper.znode.parent='/hbase',hbase.zookeeper.quorum='haisen24.ux.uis.no')\n \n## running map function\nmap \u003c- expression({\n\tlibrary(bitops)\n\tlibrary(r2time)\n\tlibrary(gtools)\n\tlen \u003c- 0\n\tm \u003c- lapply(seq_along(map.values), function(r) {\n\t \tattr \u003c- names(map.values[[r]]);\n\t\tleng \u003c-  length(attr)\n\t\t})\n\t \trhcollect(1,sum(unlist(m)))\n })\n\n#Reduce function \nreduce \u003c- expression(\n\tpre={ len \u003c- 0 }, \n\treduce={ len \u003c- len + sum(sapply(reduce.values, function(x) sum(x))) }\n\tpost={ rhcollect(reduce.key, len)\n})\n \n## Run job.\nr2t.job(table='tsdb',sdate=startdate, edate=enddate, metrics=metric, tagk=tagk, tagv=tagv, jars=jars, zooinfo=zooinfo,\toutput=outputdir, jobname=jobname, mapred=mapred, map=map, reduce=reduce, setup=NULL)\nt = rhread(outputdir)\n```\n\n\n### LIST OF FUNCTIONS ###\n\nr2t.job:\nSubmit job to MapReduce. \nInput Parameters:\n```\ntable = name of the table by default 'tsdb'\nsdate = Start data of metric\nedate = End date of Metric\nMetrics= Name of metric\ntagk = List of tag keys\ntagv = List of tag values\njars = list of jars files in HDFS location\noutput = Path of output result to be stored in HDFS.\nzooinfo = Zookeeper informations\njobname = Name of job by default MapReduce Job\nmap = name of map function\nreduce = name of reduce function, if no reduce assign 0\nsetup = initialization function need before map function. \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbikash%2Fr2time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbikash%2Fr2time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbikash%2Fr2time/lists"}