Skip to content

Instantly share code, notes, and snippets.

@rajkrrsingh
Created October 15, 2015 15:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rajkrrsingh/452365ec4a9928953c07 to your computer and use it in GitHub Desktop.
Save rajkrrsingh/452365ec4a9928953c07 to your computer and use it in GitHub Desktop.
--get storage plugins
curl http://node3.mapr.com:8047/storage.json
--create storage plugin
curl --request POST --header "ContentType: application/json" --data '{"name": "dfs1", "config": { "type": "file", "enabled": false, "connection": "maprfs:///", "workspaces": null, "formats": null }}' http://node3.mapr.com:8047/storage/dfs1.json
{
"result" : "success"
}
--get specific storage plugin
curl http://10.10.71.14:8047/storage/dfs1.json
{
"name" : "dfs1",
"config" : {
"type" : "file",
"enabled" : false,
"connection" : "maprfs:///",
"workspaces" : null,
"formats" : null
}
}
--enable storage plugin
curl http://10.10.71.14:8047/storage/dfs1/enable/true
{
"result" : "success"
}
--delete storage plugin
curl --request DELETE http://node3.mapr.com:8047/storage/dfs1.json
{
"result" : "success"
}
--run a query
$curl --header "Content-Type:application/json" --request POST --data '{"queryType":"sql","query":"select * from cp.`employee.json` limit 1"}' http://node3.mapr.com:8047/query.json
{
"columns" : [ "employee_id", "full_name", "first_name", "last_name", "position_id", "position_title", "store_id", "department_id", "birth_date", "hire_date", "salary", "supervisor_id", "education_level", "marital_status", "gender", "management_role" ],
"rows" : [ {
"hire_date" : "1994-12-01 00:00:00.0",
"birth_date" : "1961-08-26",
"department_id" : "1",
"store_id" : "0",
"education_level" : "Graduate Degree",
"first_name" : "Sheri",
"position_id" : "1",
"management_role" : "Senior Management",
"last_name" : "Nowmer",
"gender" : "F",
"position_title" : "President",
"marital_status" : "S",
"salary" : "80000.0",
"employee_id" : "1",
"supervisor_id" : "0",
"full_name" : "Sheri Nowmer"
} ]
--look profiles of running as well as completed query
curl http://node3.mapr.com:8047/profiles.json
{
"runningQueries" : [ ],
"finishedQueries" : [ {
"queryId" : "29e04874-ac9a-d342-a531-94026c60a23d",
"time" : "10/15/2015 19:56:18",
"location" : "http://localhost:8047/profile/29e04874-ac9a-d342-a531-94026c60a23d.json",
"foreman" : "node3.mapr.com",
"query" : "select * from cp.`employee.json` limit 1",
"state" : "COMPLETED",
"user" : "anonymous"
}
}
-- Access specific profile
curl http://node3.mapr.com:8047/profiles/29e04874-ac9a-d342-a531-94026c60a23d.json
{"id":{"part1":3017491416287466306,"part2":-6543286045463502275},"type":1,"start":1444919178129,"end":1444919178477,"query":"select * from cp.`employee.json` limit 1","plan":"00-00 Screen : rowType = RecordType(ANY *): rowcount = 1.0, cumulative cost = {465.1 rows, 468.1 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 319\n00-01 Project(*=[$0]) : rowType = RecordType(ANY *): rowcount = 1.0, cumulative cost = {465.0 rows, 468.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 318\n00-02 SelectionVectorRemover : rowType = (DrillRecordRow[*]): rowcount = 1.0, cumulative cost = {465.0 rows, 468.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 317\n00-03 Limit(fetch=[1]) : rowType = (DrillRecordRow[*]): rowcount = 1.0, cumulative cost = {464.0 rows, 467.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 316\n00-04 Scan(groupscan=[EasyGroupScan [selectionRoot=classpath:/employee.json, numFiles=1, columns=[`*`], files=[classpath:/employee.json]]]) : rowType = (DrillRecordRow[*]): rowcount = 463.0, cumulative cost = {463.0 rows, 463.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 315\n","foreman":{"address":"node3.mapr.com","userPort":31010,"controlPort":31011,"dataPort":31012},"state":2,"totalFragments":1,"finishedFragments":0,"fragmentProfile":[{"majorFragmentId":0,"minorFragmentProfile":[{"state":3,"minorFragmentId":0,"operatorProfile":[{"inputProfile":[{"records":1155,"batches":1,"schemas":1}],"operatorId":4,"operatorType":29,"setupNanos":0,"processNanos":218248339,"peakLocalMemoryAllocated":753664,"waitNanos":257759},{"inputProfile":[{"records":1155,"batches":1,"schemas":1}],"operatorId":3,"operatorType":7,"setupNanos":652445,"processNanos":307592,"peakLocalMemoryAllocated":2310,"waitNanos":0},{"inputProfile":[{"records":1,"batches":1,"schemas":1}],"operatorId":2,"operatorType":14,"setupNanos":18696165,"processNanos":1823045,"peakLocalMemoryAllocated":532540,"waitNanos":0},{"inputProfile":[{"records":1,"batches":1,"schemas":1}],"operatorId":1,"operatorType":10,"setupNanos":1453550,"processNanos":521909,"peakLocalMemoryAllocated":0,"waitNanos":0},{"inputProfile":[{"records":1,"batches":1,"schemas":1}],"operatorId":0,"operatorType":13,"setupNanos":0,"processNanos":1394229,"peakLocalMemoryAllocated":0,"metric":[{"metricId":0,"longValue":241}],"waitNanos":9035099}],"startTime":1444919178215,"endTime":1444919178473,"memoryUsed":0,"maxMemoryUsed":5000256,"endpoint":{"address":"node3.mapr.com","userPort":31010,"controlPort":31011,"dataPort":31012},"lastUpdate":1444919178474,"lastProgress":1444919178474}]}],"user":"anonymous"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment