Skip to content

Developer Guide

dark edited this page Sep 13, 2019 · 34 revisions

Overview

This page explains a developer to set up a graphene project for contributing.
Firstly, if you want to understand graphene go to the graphene concepts page.

We will set up the environment for developing Graphene application in the following order.

  1. Infrastructure settings
  2. Run application at Intellij

1. Infrastructure settings

First, Set up the infrastructure for developing and testing:

$ git clone https://github.com/Dark0096/graphene
$ cd graphene
$ docker-compose up -d

Second, Create Elasticsearch index for the metric key.

$ curl -XPUT 'http://localhost:9200/metric' -d '{
  "mappings": {
    "path": {
      "properties": {
        "path": {
          "index": "not_analyzed",
          "type": "string"
        },
        "depth": {
          "type": "long"
        },
        "leaf": {
          "type": "boolean"
        },
        "tenant": {
          "type": "string"
        }
      }
    }
  },
  "settings": {
    "number_of_replicas": 1,
    "number_of_shards": 5
  }
}'

Third, Create Cassandra keyspace and table for metric data.

$ docker exec -it cassandra /bin/bash
$ cqlsh  
$ CREATE KEYSPACE metric WITH replication = {'class': 'NetworkTopologyStrategy', 'ap-northeast-2': '1'} AND durable_writes = true;
$ CREATE TABLE metric.metric (
  period int,
  rollup int,
  tenant text,
  path text,
  time bigint,
  data list<double>,
  PRIMARY KEY ((tenant, period, rollup, path), time)
) WITH
  bloom_filter_fp_chance=0.010000 AND
  caching='KEYS_ONLY' AND
  comment='' AND
  dclocal_read_repair_chance=0.000000 AND
  gc_grace_seconds=864000 AND
  index_interval=128 AND
  read_repair_chance=0.000000 AND
  replicate_on_write='true' AND
  populate_io_cache_on_flush='false' AND
  default_time_to_live=0 AND
  speculative_retry='NONE' AND
  memtable_flush_period_in_ms=0 AND
  compaction = {'sstable_size_in_mb': '640', 'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'} AND
  compression={'sstable_compression': 'LZ4Compressor'};

Note that: It is recommended that you allocate enough memory for the Docker engine.

2. Run application at Intellij

Clone this wiki locally