Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
krystianity committed Jun 26, 2018
1 parent bcc6ff7 commit ef90651
Show file tree
Hide file tree
Showing 26 changed files with 2,880 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ typings/

# next.js build output
.next

.idea/
.vscode/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 YildizDB - Event Relation Storage
Copyright (c) 2018 Christian Froehlingsdorf

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
56 changes: 56 additions & 0 deletions MOCKUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Mockup of this clients features

```javascript
const {BigtableFactory} = require("bigtable");

const config = {
projectId: "my-project-1",
instanceName: "my-bigtable-cluster",
keyFilename: "/bla/keyfile.json",
ttlScanIntervalMs: 3000
};

const myTableConfig = {
name: "mytable",
columnFamily: "myfamily",
defaultColumn: "default",
defaultValue: "",
maxVersions: 1
};

(async () => {

// the goal of this api is to take away the complexity of the original big table api
// by encapsulating columnFamilies and multi cell rows, via default values
// and also adding ttl and metadata with sub millisecond access per default

const myInstance = await BigtableFactory.get(myTableConfig);

const rowKey = "myrowkey";
const value = "myvalue";
const ttl = 15000;

// when column is null, the default column from the config is used
// ttl only works on cell level, if a row has no more cells, bigtable will delete the row automatically

// we create a ${config.name}_metadata table for every table we create
// we use it to keep track of cell ttls and scan them
// we use it to keep track of the current count (size) of the table

await myInstance.set(rowKey, value, ttl = null, column = null); // <- you can append by calling set with different column values
await myInstance.multiSet(rowKey, columnsObject, ttl);

await myInstance.increase(rowKey, column = null);
await myInstance.decrease(rowKey, column = null);

await myInstance.get(rowKey, column = null);
await myInstance.delete(rowKey, column = null);

await myInstance.getRow(rowKey);
await myInstance.deleteRow(rowKey);

await myInstance.ttl(rowKey, column = null); // <- answered by metadata table
await myInstance.count(); // <- answered by metadata table

})().catch(console.error);
```
7 changes: 7 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

153 changes: 153 additions & 0 deletions dist/lib/BigtableClient.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/lib/BigtableClient.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions dist/lib/BigtableFactory.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/lib/BigtableFactory.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/lib/interfaces/BigtableConfig.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/lib/interfaces/BigtableConfig.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/lib/interfaces/RetentionJobConfig.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/lib/interfaces/RetentionJobConfig.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/lib/interfaces/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/lib/interfaces/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./lib/BigtableClient";
Loading

0 comments on commit ef90651

Please sign in to comment.