Class: Teapot::TempestDB::TempestDBService::Processor

Inherits:
Object
  • Object
show all
Includes:
Thrift::Processor
Defined in:
lib/gen/tempest_d_b_service.rb

Instance Method Summary collapse

Instance Method Details

#process_addEdges(seqid, iprot, oprot) ⇒ Object



569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/gen/tempest_d_b_service.rb', line 569

def process_addEdges(seqid, iprot, oprot)
  args = read_args(iprot, AddEdges_args)
  result = AddEdges_result.new()
  begin
    @handler.addEdges(args.edgeType, args.sourceNodes, args.targetNodes)
  rescue ::Teapot::TempestDB::UndefinedGraphException => error1
    result.error1 = error1
  rescue ::Teapot::TempestDB::UnequalListSizeException => error2
    result.error2 = error2
  end
  write_result(result, oprot, 'addEdges', seqid)
end

#process_addNode(seqid, iprot, oprot) ⇒ Object



539
540
541
542
543
544
545
546
547
548
549
550
551
552
# File 'lib/gen/tempest_d_b_service.rb', line 539

def process_addNode(seqid, iprot, oprot)
  args = read_args(iprot, AddNode_args)
  result = AddNode_result.new()
  begin
    @handler.addNode(args.node)
  rescue ::Teapot::TempestDB::UndefinedGraphException => error1
    result.error1 = error1
  rescue ::Teapot::TempestDB::InvalidArgumentException => error2
    result.error2 = error2
  rescue ::Teapot::TempestDB::SQLException => error3
    result.error3 = error3
  end
  write_result(result, oprot, 'addNode', seqid)
end

#process_connectedComponent(seqid, iprot, oprot) ⇒ Object



414
415
416
417
418
419
420
421
422
423
424
425
426
427
# File 'lib/gen/tempest_d_b_service.rb', line 414

def process_connectedComponent(seqid, iprot, oprot)
  args = read_args(iprot, ConnectedComponent_args)
  result = ConnectedComponent_result.new()
  begin
    result.success = @handler.connectedComponent(args.source, args.edgeTypes, args.maxSize)
  rescue ::Teapot::TempestDB::UndefinedGraphException => error1
    result.error1 = error1
  rescue ::Teapot::TempestDB::InvalidNodeIdException => error2
    result.error2 = error2
  rescue ::Teapot::TempestDB::InvalidArgumentException => error3
    result.error3 = error3
  end
  write_result(result, oprot, 'connectedComponent', seqid)
end

#process_edgeCount(seqid, iprot, oprot) ⇒ Object



502
503
504
505
506
507
508
509
510
511
# File 'lib/gen/tempest_d_b_service.rb', line 502

def process_edgeCount(seqid, iprot, oprot)
  args = read_args(iprot, EdgeCount_args)
  result = EdgeCount_result.new()
  begin
    result.success = @handler.edgeCount(args.edgeType)
  rescue ::Teapot::TempestDB::InvalidArgumentException => ex
    result.ex = ex
  end
  write_result(result, oprot, 'edgeCount', seqid)
end

#process_getMultiNodeAttributeAsJSON(seqid, iprot, oprot) ⇒ Object



526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/gen/tempest_d_b_service.rb', line 526

def process_getMultiNodeAttributeAsJSON(seqid, iprot, oprot)
  args = read_args(iprot, GetMultiNodeAttributeAsJSON_args)
  result = GetMultiNodeAttributeAsJSON_result.new()
  begin
    result.success = @handler.getMultiNodeAttributeAsJSON(args.nodes, args.attributeName)
  rescue ::Teapot::TempestDB::UndefinedGraphException => error1
    result.error1 = error1
  rescue ::Teapot::TempestDB::InvalidArgumentException => error2
    result.error2 = error2
  end
  write_result(result, oprot, 'getMultiNodeAttributeAsJSON', seqid)
end

#process_inDegree(seqid, iprot, oprot) ⇒ Object



345
346
347
348
349
350
351
352
353
354
355
356
# File 'lib/gen/tempest_d_b_service.rb', line 345

def process_inDegree(seqid, iprot, oprot)
  args = read_args(iprot, InDegree_args)
  result = InDegree_result.new()
  begin
    result.success = @handler.inDegree(args.edgeType, args.node)
  rescue ::Teapot::TempestDB::InvalidNodeIdException => ex1
    result.ex1 = ex1
  rescue ::Teapot::TempestDB::InvalidArgumentException => ex2
    result.ex2 = ex2
  end
  write_result(result, oprot, 'inDegree', seqid)
end

#process_inNeighbor(seqid, iprot, oprot) ⇒ Object



399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/gen/tempest_d_b_service.rb', line 399

def process_inNeighbor(seqid, iprot, oprot)
  args = read_args(iprot, InNeighbor_args)
  result = InNeighbor_result.new()
  begin
    result.success = @handler.inNeighbor(args.edgeType, args.node, args.i)
  rescue ::Teapot::TempestDB::InvalidNodeIdException => ex1
    result.ex1 = ex1
  rescue ::Teapot::TempestDB::InvalidIndexException => ex2
    result.ex2 = ex2
  rescue ::Teapot::TempestDB::InvalidArgumentException => ex3
    result.ex3 = ex3
  end
  write_result(result, oprot, 'inNeighbor', seqid)
end

#process_inNeighbors(seqid, iprot, oprot) ⇒ Object



371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/gen/tempest_d_b_service.rb', line 371

def process_inNeighbors(seqid, iprot, oprot)
  args = read_args(iprot, InNeighbors_args)
  result = InNeighbors_result.new()
  begin
    result.success = @handler.inNeighbors(args.edgeType, args.node)
  rescue ::Teapot::TempestDB::InvalidNodeIdException => ex1
    result.ex1 = ex1
  rescue ::Teapot::TempestDB::InvalidArgumentException => ex2
    result.ex2 = ex2
  end
  write_result(result, oprot, 'inNeighbors', seqid)
end

#process_kStepInNeighborsFiltered(seqid, iprot, oprot) ⇒ Object



446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/gen/tempest_d_b_service.rb', line 446

def process_kStepInNeighborsFiltered(seqid, iprot, oprot)
  args = read_args(iprot, KStepInNeighborsFiltered_args)
  result = KStepInNeighborsFiltered_result.new()
  begin
    result.success = @handler.kStepInNeighborsFiltered(args.edgeType, args.source, args.k, args.sqlClause, args.filter, args.alternating)
  rescue ::Teapot::TempestDB::UndefinedGraphException => error1
    result.error1 = error1
  rescue ::Teapot::TempestDB::InvalidArgumentException => error2
    result.error2 = error2
  rescue ::Teapot::TempestDB::SQLException => error3
    result.error3 = error3
  rescue ::Teapot::TempestDB::InvalidNodeIdException => error4
    result.error4 = error4
  end
  write_result(result, oprot, 'kStepInNeighborsFiltered', seqid)
end

#process_kStepOutNeighborsFiltered(seqid, iprot, oprot) ⇒ Object



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/gen/tempest_d_b_service.rb', line 429

def process_kStepOutNeighborsFiltered(seqid, iprot, oprot)
  args = read_args(iprot, KStepOutNeighborsFiltered_args)
  result = KStepOutNeighborsFiltered_result.new()
  begin
    result.success = @handler.kStepOutNeighborsFiltered(args.edgeType, args.source, args.k, args.sqlClause, args.filter, args.alternating)
  rescue ::Teapot::TempestDB::UndefinedGraphException => error1
    result.error1 = error1
  rescue ::Teapot::TempestDB::InvalidArgumentException => error2
    result.error2 = error2
  rescue ::Teapot::TempestDB::SQLException => error3
    result.error3 = error3
  rescue ::Teapot::TempestDB::InvalidNodeIdException => error4
    result.error4 = error4
  end
  write_result(result, oprot, 'kStepOutNeighborsFiltered', seqid)
end

#process_nodeCount(seqid, iprot, oprot) ⇒ Object



491
492
493
494
495
496
497
498
499
500
# File 'lib/gen/tempest_d_b_service.rb', line 491

def process_nodeCount(seqid, iprot, oprot)
  args = read_args(iprot, NodeCount_args)
  result = NodeCount_result.new()
  begin
    result.success = @handler.nodeCount(args.edgeType)
  rescue ::Teapot::TempestDB::InvalidArgumentException => ex
    result.ex = ex
  end
  write_result(result, oprot, 'nodeCount', seqid)
end

#process_nodes(seqid, iprot, oprot) ⇒ Object



513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/gen/tempest_d_b_service.rb', line 513

def process_nodes(seqid, iprot, oprot)
  args = read_args(iprot, Nodes_args)
  result = Nodes_result.new()
  begin
    result.success = @handler.nodes(args.nodeType, args.sqlClause)
  rescue ::Teapot::TempestDB::UndefinedGraphException => error1
    result.error1 = error1
  rescue ::Teapot::TempestDB::SQLException => error2
    result.error2 = error2
  end
  write_result(result, oprot, 'nodes', seqid)
end

#process_outDegree(seqid, iprot, oprot) ⇒ Object



332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/gen/tempest_d_b_service.rb', line 332

def process_outDegree(seqid, iprot, oprot)
  args = read_args(iprot, OutDegree_args)
  result = OutDegree_result.new()
  begin
    result.success = @handler.outDegree(args.edgeType, args.node)
  rescue ::Teapot::TempestDB::InvalidNodeIdException => ex1
    result.ex1 = ex1
  rescue ::Teapot::TempestDB::InvalidArgumentException => ex2
    result.ex2 = ex2
  end
  write_result(result, oprot, 'outDegree', seqid)
end

#process_outNeighbor(seqid, iprot, oprot) ⇒ Object



384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/gen/tempest_d_b_service.rb', line 384

def process_outNeighbor(seqid, iprot, oprot)
  args = read_args(iprot, OutNeighbor_args)
  result = OutNeighbor_result.new()
  begin
    result.success = @handler.outNeighbor(args.edgeType, args.node, args.i)
  rescue ::Teapot::TempestDB::InvalidNodeIdException => ex1
    result.ex1 = ex1
  rescue ::Teapot::TempestDB::InvalidIndexException => ex2
    result.ex2 = ex2
  rescue ::Teapot::TempestDB::InvalidArgumentException => ex3
    result.ex3 = ex3
  end
  write_result(result, oprot, 'outNeighbor', seqid)
end

#process_outNeighbors(seqid, iprot, oprot) ⇒ Object



358
359
360
361
362
363
364
365
366
367
368
369
# File 'lib/gen/tempest_d_b_service.rb', line 358

def process_outNeighbors(seqid, iprot, oprot)
  args = read_args(iprot, OutNeighbors_args)
  result = OutNeighbors_result.new()
  begin
    result.success = @handler.outNeighbors(args.edgeType, args.node)
  rescue ::Teapot::TempestDB::InvalidNodeIdException => ex1
    result.ex1 = ex1
  rescue ::Teapot::TempestDB::InvalidArgumentException => ex2
    result.ex2 = ex2
  end
  write_result(result, oprot, 'outNeighbors', seqid)
end

#process_pprSingleTarget(seqid, iprot, oprot) ⇒ Object



478
479
480
481
482
483
484
485
486
487
488
489
# File 'lib/gen/tempest_d_b_service.rb', line 478

def process_pprSingleTarget(seqid, iprot, oprot)
  args = read_args(iprot, PprSingleTarget_args)
  result = PprSingleTarget_result.new()
  begin
    result.success = @handler.pprSingleTarget(args.edgeType, args.seedNodes, args.targetNode, args.biPPRParams)
  rescue ::Teapot::TempestDB::InvalidNodeIdException => ex1
    result.ex1 = ex1
  rescue ::Teapot::TempestDB::InvalidArgumentException => ex2
    result.ex2 = ex2
  end
  write_result(result, oprot, 'pprSingleTarget', seqid)
end

#process_pprUndirected(seqid, iprot, oprot) ⇒ Object



463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'lib/gen/tempest_d_b_service.rb', line 463

def process_pprUndirected(seqid, iprot, oprot)
  args = read_args(iprot, PprUndirected_args)
  result = PprUndirected_result.new()
  begin
    result.success = @handler.pprUndirected(args.edgeTypes, args.seeds, args.pageRankParams)
  rescue ::Teapot::TempestDB::UndefinedGraphException => error1
    result.error1 = error1
  rescue ::Teapot::TempestDB::InvalidNodeIdException => error2
    result.error2 = error2
  rescue ::Teapot::TempestDB::InvalidArgumentException => error3
    result.error3 = error3
  end
  write_result(result, oprot, 'pprUndirected', seqid)
end

#process_setNodeAttribute(seqid, iprot, oprot) ⇒ Object



554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/gen/tempest_d_b_service.rb', line 554

def process_setNodeAttribute(seqid, iprot, oprot)
  args = read_args(iprot, SetNodeAttribute_args)
  result = SetNodeAttribute_result.new()
  begin
    @handler.setNodeAttribute(args.node, args.attributeName, args.attributeValue)
  rescue ::Teapot::TempestDB::UndefinedGraphException => error1
    result.error1 = error1
  rescue ::Teapot::TempestDB::InvalidArgumentException => error2
    result.error2 = error2
  rescue ::Teapot::TempestDB::SQLException => error3
    result.error3 = error3
  end
  write_result(result, oprot, 'setNodeAttribute', seqid)
end