Class: Relevanced::Processor

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

Instance Method Summary collapse

Instance Method Details

#process_addDocumentToCentroid(seqid, iprot, oprot) ⇒ Object



644
645
646
647
648
649
650
651
652
653
654
655
656
657
# File 'lib/gen-rb/relevanced.rb', line 644

def process_addDocumentToCentroid(seqid, iprot, oprot)
  args = read_args(iprot, AddDocumentToCentroid_args)
  result = AddDocumentToCentroid_result.new()
  begin
    result.success = @handler.addDocumentToCentroid(args.centroidId, args.docId)
  rescue ::ECentroidDoesNotExist => centroidErr
    result.centroidErr = centroidErr
  rescue ::EDocumentDoesNotExist => docErr
    result.docErr = docErr
  rescue ::EDocumentAlreadyInCentroid => bothErr
    result.bothErr = bothErr
  end
  write_result(result, oprot, 'addDocumentToCentroid', seqid)
end

#process_createCentroid(seqid, iprot, oprot) ⇒ Object



589
590
591
592
593
594
595
596
597
598
# File 'lib/gen-rb/relevanced.rb', line 589

def process_createCentroid(seqid, iprot, oprot)
  args = read_args(iprot, CreateCentroid_args)
  result = CreateCentroid_result.new()
  begin
    result.success = @handler.createCentroid(args.centroidId)
  rescue ::ECentroidAlreadyExists => err
    result.err = err
  end
  write_result(result, oprot, 'createCentroid', seqid)
end

#process_createDocument(seqid, iprot, oprot) ⇒ Object



549
550
551
552
553
554
# File 'lib/gen-rb/relevanced.rb', line 549

def process_createDocument(seqid, iprot, oprot)
  args = read_args(iprot, CreateDocument_args)
  result = CreateDocument_result.new()
  result.success = @handler.createDocument(args.text, args.language)
  write_result(result, oprot, 'createDocument', seqid)
end

#process_createDocumentWithID(seqid, iprot, oprot) ⇒ Object



556
557
558
559
560
561
562
563
564
565
# File 'lib/gen-rb/relevanced.rb', line 556

def process_createDocumentWithID(seqid, iprot, oprot)
  args = read_args(iprot, CreateDocumentWithID_args)
  result = CreateDocumentWithID_result.new()
  begin
    result.success = @handler.createDocumentWithID(args.id, args.text, args.language)
  rescue ::EDocumentAlreadyExists => err
    result.err = err
  end
  write_result(result, oprot, 'createDocumentWithID', seqid)
end

#process_debugEraseAllData(seqid, iprot, oprot) ⇒ Object



734
735
736
737
738
739
# File 'lib/gen-rb/relevanced.rb', line 734

def process_debugEraseAllData(seqid, iprot, oprot)
  args = read_args(iprot, DebugEraseAllData_args)
  result = DebugEraseAllData_result.new()
  @handler.debugEraseAllData()
  write_result(result, oprot, 'debugEraseAllData', seqid)
end

#process_debugGetFullCentroid(seqid, iprot, oprot) ⇒ Object



741
742
743
744
745
746
747
748
749
750
# File 'lib/gen-rb/relevanced.rb', line 741

def process_debugGetFullCentroid(seqid, iprot, oprot)
  args = read_args(iprot, DebugGetFullCentroid_args)
  result = DebugGetFullCentroid_result.new()
  begin
    result.success = @handler.debugGetFullCentroid(args.centroidId)
  rescue ::ECentroidDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'debugGetFullCentroid', seqid)
end

#process_debugGetFullProcessedDocument(seqid, iprot, oprot) ⇒ Object



752
753
754
755
756
757
758
759
760
761
# File 'lib/gen-rb/relevanced.rb', line 752

def process_debugGetFullProcessedDocument(seqid, iprot, oprot)
  args = read_args(iprot, DebugGetFullProcessedDocument_args)
  result = DebugGetFullProcessedDocument_result.new()
  begin
    result.success = @handler.debugGetFullProcessedDocument(args.documentId)
  rescue ::EDocumentDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'debugGetFullProcessedDocument', seqid)
end

#process_deleteCentroid(seqid, iprot, oprot) ⇒ Object



600
601
602
603
604
605
606
607
608
609
# File 'lib/gen-rb/relevanced.rb', line 600

def process_deleteCentroid(seqid, iprot, oprot)
  args = read_args(iprot, DeleteCentroid_args)
  result = DeleteCentroid_result.new()
  begin
    result.success = @handler.deleteCentroid(args.centroidId)
  rescue ::ECentroidDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'deleteCentroid', seqid)
end

#process_deleteDocument(seqid, iprot, oprot) ⇒ Object



567
568
569
570
571
572
573
574
575
576
# File 'lib/gen-rb/relevanced.rb', line 567

def process_deleteDocument(seqid, iprot, oprot)
  args = read_args(iprot, DeleteDocument_args)
  result = DeleteDocument_result.new()
  begin
    result.success = @handler.deleteDocument(args.id)
  rescue ::EDocumentDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'deleteDocument', seqid)
end

#process_getCentroidSimilarity(seqid, iprot, oprot) ⇒ Object



538
539
540
541
542
543
544
545
546
547
# File 'lib/gen-rb/relevanced.rb', line 538

def process_getCentroidSimilarity(seqid, iprot, oprot)
  args = read_args(iprot, GetCentroidSimilarity_args)
  result = GetCentroidSimilarity_result.new()
  begin
    result.success = @handler.getCentroidSimilarity(args.centroid1Id, args.centroid2Id)
  rescue ::ECentroidDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'getCentroidSimilarity', seqid)
end

#process_getDocumentMetadata(seqid, iprot, oprot) ⇒ Object



578
579
580
581
582
583
584
585
586
587
# File 'lib/gen-rb/relevanced.rb', line 578

def (seqid, iprot, oprot)
  args = read_args(iprot, )
  result = .new()
  begin
    result.success = @handler.(args.id)
  rescue ::EDocumentDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'getDocumentMetadata', seqid)
end

#process_getDocumentSimilarity(seqid, iprot, oprot) ⇒ Object



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

def process_getDocumentSimilarity(seqid, iprot, oprot)
  args = read_args(iprot, GetDocumentSimilarity_args)
  result = GetDocumentSimilarity_result.new()
  begin
    result.success = @handler.getDocumentSimilarity(args.centroidId, args.docId)
  rescue ::ECentroidDoesNotExist => centroidErr
    result.centroidErr = centroidErr
  rescue ::EDocumentDoesNotExist => docErr
    result.docErr = docErr
  end
  write_result(result, oprot, 'getDocumentSimilarity', seqid)
end

#process_getServerMetadata(seqid, iprot, oprot) ⇒ Object



483
484
485
486
487
488
# File 'lib/gen-rb/relevanced.rb', line 483

def (seqid, iprot, oprot)
  args = read_args(iprot, )
  result = .new()
  result.success = @handler.()
  write_result(result, oprot, 'getServerMetadata', seqid)
end

#process_getTextSimilarity(seqid, iprot, oprot) ⇒ Object



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

def process_getTextSimilarity(seqid, iprot, oprot)
  args = read_args(iprot, GetTextSimilarity_args)
  result = GetTextSimilarity_result.new()
  begin
    result.success = @handler.getTextSimilarity(args.centroidId, args.text, args.lang)
  rescue ::ECentroidDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'getTextSimilarity', seqid)
end

#process_joinCentroid(seqid, iprot, oprot) ⇒ Object



674
675
676
677
678
679
680
681
682
683
# File 'lib/gen-rb/relevanced.rb', line 674

def process_joinCentroid(seqid, iprot, oprot)
  args = read_args(iprot, JoinCentroid_args)
  result = JoinCentroid_result.new()
  begin
    result.success = @handler.joinCentroid(args.centroidId)
  rescue ::ECentroidDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'joinCentroid', seqid)
end

#process_listAllCentroids(seqid, iprot, oprot) ⇒ Object



685
686
687
688
689
690
# File 'lib/gen-rb/relevanced.rb', line 685

def process_listAllCentroids(seqid, iprot, oprot)
  args = read_args(iprot, ListAllCentroids_args)
  result = ListAllCentroids_result.new()
  result.success = @handler.listAllCentroids()
  write_result(result, oprot, 'listAllCentroids', seqid)
end

#process_listAllDocuments(seqid, iprot, oprot) ⇒ Object



706
707
708
709
710
711
# File 'lib/gen-rb/relevanced.rb', line 706

def process_listAllDocuments(seqid, iprot, oprot)
  args = read_args(iprot, ListAllDocuments_args)
  result = ListAllDocuments_result.new()
  result.success = @handler.listAllDocuments()
  write_result(result, oprot, 'listAllDocuments', seqid)
end

#process_listAllDocumentsForCentroid(seqid, iprot, oprot) ⇒ Object



611
612
613
614
615
616
617
618
619
620
# File 'lib/gen-rb/relevanced.rb', line 611

def process_listAllDocumentsForCentroid(seqid, iprot, oprot)
  args = read_args(iprot, ListAllDocumentsForCentroid_args)
  result = ListAllDocumentsForCentroid_result.new()
  begin
    result.success = @handler.listAllDocumentsForCentroid(args.centroidId)
  rescue ::ECentroidDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'listAllDocumentsForCentroid', seqid)
end

#process_listCentroidDocumentRange(seqid, iprot, oprot) ⇒ Object



622
623
624
625
626
627
628
629
630
631
# File 'lib/gen-rb/relevanced.rb', line 622

def process_listCentroidDocumentRange(seqid, iprot, oprot)
  args = read_args(iprot, ListCentroidDocumentRange_args)
  result = ListCentroidDocumentRange_result.new()
  begin
    result.success = @handler.listCentroidDocumentRange(args.centroidId, args.offset, args.count)
  rescue ::ECentroidDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'listCentroidDocumentRange', seqid)
end

#process_listCentroidDocumentRangeFromID(seqid, iprot, oprot) ⇒ Object



633
634
635
636
637
638
639
640
641
642
# File 'lib/gen-rb/relevanced.rb', line 633

def process_listCentroidDocumentRangeFromID(seqid, iprot, oprot)
  args = read_args(iprot, ListCentroidDocumentRangeFromID_args)
  result = ListCentroidDocumentRangeFromID_result.new()
  begin
    result.success = @handler.listCentroidDocumentRangeFromID(args.centroidId, args.documentId, args.count)
  rescue ::ECentroidDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'listCentroidDocumentRangeFromID', seqid)
end

#process_listCentroidRange(seqid, iprot, oprot) ⇒ Object



692
693
694
695
696
697
# File 'lib/gen-rb/relevanced.rb', line 692

def process_listCentroidRange(seqid, iprot, oprot)
  args = read_args(iprot, ListCentroidRange_args)
  result = ListCentroidRange_result.new()
  result.success = @handler.listCentroidRange(args.offset, args.count)
  write_result(result, oprot, 'listCentroidRange', seqid)
end

#process_listCentroidRangeFromID(seqid, iprot, oprot) ⇒ Object



699
700
701
702
703
704
# File 'lib/gen-rb/relevanced.rb', line 699

def process_listCentroidRangeFromID(seqid, iprot, oprot)
  args = read_args(iprot, ListCentroidRangeFromID_args)
  result = ListCentroidRangeFromID_result.new()
  result.success = @handler.listCentroidRangeFromID(args.centroidId, args.count)
  write_result(result, oprot, 'listCentroidRangeFromID', seqid)
end

#process_listDocumentRange(seqid, iprot, oprot) ⇒ Object



720
721
722
723
724
725
# File 'lib/gen-rb/relevanced.rb', line 720

def process_listDocumentRange(seqid, iprot, oprot)
  args = read_args(iprot, ListDocumentRange_args)
  result = ListDocumentRange_result.new()
  result.success = @handler.listDocumentRange(args.offset, args.count)
  write_result(result, oprot, 'listDocumentRange', seqid)
end

#process_listDocumentRangeFromID(seqid, iprot, oprot) ⇒ Object



727
728
729
730
731
732
# File 'lib/gen-rb/relevanced.rb', line 727

def process_listDocumentRangeFromID(seqid, iprot, oprot)
  args = read_args(iprot, ListDocumentRangeFromID_args)
  result = ListDocumentRangeFromID_result.new()
  result.success = @handler.listDocumentRangeFromID(args.documentId, args.count)
  write_result(result, oprot, 'listDocumentRangeFromID', seqid)
end

#process_listUnusedDocuments(seqid, iprot, oprot) ⇒ Object



713
714
715
716
717
718
# File 'lib/gen-rb/relevanced.rb', line 713

def process_listUnusedDocuments(seqid, iprot, oprot)
  args = read_args(iprot, ListUnusedDocuments_args)
  result = ListUnusedDocuments_result.new()
  result.success = @handler.listUnusedDocuments(args.limit)
  write_result(result, oprot, 'listUnusedDocuments', seqid)
end

#process_multiGetDocumentSimilarity(seqid, iprot, oprot) ⇒ Object



503
504
505
506
507
508
509
510
511
512
513
514
# File 'lib/gen-rb/relevanced.rb', line 503

def process_multiGetDocumentSimilarity(seqid, iprot, oprot)
  args = read_args(iprot, MultiGetDocumentSimilarity_args)
  result = MultiGetDocumentSimilarity_result.new()
  begin
    result.success = @handler.multiGetDocumentSimilarity(args.centroidIds, args.documentId)
  rescue ::ECentroidDoesNotExist => centroidErr
    result.centroidErr = centroidErr
  rescue ::EDocumentDoesNotExist => docErr
    result.docErr = docErr
  end
  write_result(result, oprot, 'multiGetDocumentSimilarity', seqid)
end

#process_multiGetTextSimilarity(seqid, iprot, oprot) ⇒ Object



516
517
518
519
520
521
522
523
524
525
# File 'lib/gen-rb/relevanced.rb', line 516

def process_multiGetTextSimilarity(seqid, iprot, oprot)
  args = read_args(iprot, MultiGetTextSimilarity_args)
  result = MultiGetTextSimilarity_result.new()
  begin
    result.success = @handler.multiGetTextSimilarity(args.centroidIds, args.text, args.lang)
  rescue ::ECentroidDoesNotExist => err
    result.err = err
  end
  write_result(result, oprot, 'multiGetTextSimilarity', seqid)
end

#process_ping(seqid, iprot, oprot) ⇒ Object



476
477
478
479
480
481
# File 'lib/gen-rb/relevanced.rb', line 476

def process_ping(seqid, iprot, oprot)
  args = read_args(iprot, Ping_args)
  result = Ping_result.new()
  @handler.ping()
  write_result(result, oprot, 'ping', seqid)
end

#process_removeDocumentFromCentroid(seqid, iprot, oprot) ⇒ Object



659
660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'lib/gen-rb/relevanced.rb', line 659

def process_removeDocumentFromCentroid(seqid, iprot, oprot)
  args = read_args(iprot, RemoveDocumentFromCentroid_args)
  result = RemoveDocumentFromCentroid_result.new()
  begin
    result.success = @handler.removeDocumentFromCentroid(args.centroidId, args.docId)
  rescue ::ECentroidDoesNotExist => centroidErr
    result.centroidErr = centroidErr
  rescue ::EDocumentDoesNotExist => docErr
    result.docErr = docErr
  rescue ::EDocumentNotInCentroid => bothErr
    result.bothErr = bothErr
  end
  write_result(result, oprot, 'removeDocumentFromCentroid', seqid)
end