Giter VIP home page Giter VIP logo

alibabacloud-gdb-tools's Introduction

Alibaba Cloud Graph Database Service (GDB) Tools

中文版 README

GdbDataRemover

Dependencies

GdbDataRemover depends on:

  • gremlinpython
  • argparse
  • futures

The following command can be used to install all of them:

pip install -r requirements.txt --user

Summary

As GDB supports transaction, all operation in a DSL execute in the same transaction. If simpely run g.V().drop() towards an instance with lots of data, the query will fail caused by limitation of transaction buffer.

GdbDataRemover supports four scenarios:

  • Drop all vertices inside GDB (Including related edges)
  • Drop vertices with specified Label inside GDB (Including related edges)
  • Drop all edges inside GDB
  • drop edges with specified Label inside GDB

The tool wil drop data with limitation (default 500) speficied by user.

Hints for parameters below:

  • gdb_end_point: format looks like 'gds-xxx.graphdb.rds.aliyuncs.com'
  • gdb_port:When use internal address,port is 8182;When use public address,port is 3734
  • edge: When timeout Exception during drop vertices, please try to drop edges at first by add --edge

Drop all vertices

python GdbDataRemover.py --host ${gdb_end_point} --port ${gdb_port} --username ${gdb_user} --password ${gdb_pwd}

Drop vertices with label player

python GdbDataRemover.py --host ${gdb_end_point} --port ${gdb_port} --username ${gdb_user} --password ${gdb_pwd} --label player

Drop all edges

python GdbDataRemover.py --host ${gdb_end_point} --port ${gdb_port} --username ${gdb_user} --password ${gdb_pwd} --edge

Drop edges with label knows

python GdbDataRemover.py --host ${gdb_end_point} --port ${gdb_port} --username ${gdb_user} --password ${gdb_pwd} --edge --label knows

GdbLoader

A tool for GDB Loader which imports OSS data to GDB, it could make requests as follow:

  • Add new task to import CSV file(s) on OSS to GDB
  • Get the task list on GDB, return the task loaderId(uuid) list
  • Get detail info of one task, include process records, errors
  • Delete a task, it will stop the running task at first

This tool is just a simple shell of GDB OSS Loader, you could integrate it to your project as an example

Add a new task

python GdbLoader.py --host ${gdb_end_point} --port ${gdb_port} --username ${gdb_user} --password ${gdb_pwd} --todo add_task --source ${source} --arn ${ramRoleArn}

# or

python GdbLoader.py --host ${gdb_end_point} --port ${gdb_port} --username ${gdb_user} --password ${gdb_pwd} --todo add_task --source ${source} --ak ${accessKey} --sk ${secretKey}

Query the detail of task

python GdbLoader.py --host ${gdb_end_point} --port ${gdb_port} --username ${gdb_user} --password ${gdb_pwd} --todo get_task --loaderId ${uuid}

Delete one task

python GdbLoader.py --host ${gdb_end_point} --port ${gdb_port} --username ${gdb_user} --password ${gdb_pwd} --todo delete_task --loaderId ${uuid}

List all tasks

python GdbLoader.py --host ${gdb_end_point} --port ${gdb_port} --username ${gdb_user} --password ${gdb_pwd} --todo list_task

alibabacloud-gdb-tools's People

Contributors

heljoyliu avatar qianlong-qll avatar sel-fish avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.