This Repo contains the main "database" running an http-api exposing the quadtree.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
emile ff52df6d4a Merge remote-tracking branch 'origin/postgresql' into postgresql 6 months ago
makeblend cron commit 9 months ago
public cron commit 9 months ago
.gitignore added the centerofmassendpoint and the genforesttree endpoint 7 months ago
200000.csv working! 7 months ago
Dockerfile push before using everything in docker swarm 8 months ago
README.md added the go report card 6 months ago
docker-compose.yml updated the api 6 months ago
go.mod updated the api 6 months ago
go.sum updated the api 6 months ago
http.go updated the api 6 months ago
insertcsv.sh finally finished implementing the updateCenterOfMass handler and because that was so much fun, I also implemented the genForestTreeHandler ... 7 months ago
insertdouble.sh finally finished implementing the updateCenterOfMass handler and because that was so much fun, I also implemented the genForestTreeHandler ... 7 months ago
main.go updated the api 6 months ago
out.txt working! 7 months ago
prometheus.yml defining where prometheus and the postgresql-exporter are for scraping metrics (WIP) 7 months ago
test.sh new model, see the wiki for a description how this all works 7 months ago

README.md

Go Report Card

db-container

This Repo contains the main “database” running an http-api exposing the quadtree.

API-Endpoints

Endpoint Description POST parameters
"/" Index
"/new" Create a new star w
"/printall" Print all the trees in json
"/insert/{treeindex}" Insert the given star into the selected tree x, y, vx, vy, m
"/starlist/{treeindex}" List all the stars in the selected tree
"/dumptree/{treeindex}" Dump the json of the selected tree
"/updatetotalmass/{treeindex}" Update the total mass in the selected tree
"/updatecenterofmass/{treeindex}" Update the center of mass in the selected tree
"/metrics" Get the overall metrics
"/export/{treeindex}" Export the selected tree to db/{treeindex}.json
"/fastinsert/{filename}" Insert the selected file into a new tree

Tables

nodes

-- Table: public.nodes

-- DROP TABLE public.nodes;

CREATE TABLE public.nodes
(
    node_id bigint NOT NULL DEFAULT nextval('nodes_node_id_seq'::regclass),
    box_center_x numeric,
    box_center_y numeric,
    box_width numeric,
    center_of_mass_x numeric,
    center_of_mass_y numeric,
    total_mass numeric,
    depth numeric,
    star_id bigint,
    "subnode_A" bigint,
    "subnode_B" bigint,
    "subnode_C" bigint,
    "subnode_D" bigint,
    CONSTRAINT nodes_pkey PRIMARY KEY (node_id)
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public.nodes
    OWNER to postgres;