Skip to content

Commit

Permalink
change log level to info
Browse files Browse the repository at this point in the history
Signed-off-by: xuxinkun <[email protected]>
  • Loading branch information
xuxinkun committed May 15, 2020
1 parent 5c9602c commit 6e1142a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ And presto read cursor from the cache.
In case the kubeconfig file is located at `/root/.kube/config`. Just run and enjoy.

```
[root@localhost kubesql]# docker run -it -d --name kubesql -v /root/.kube/config:/home/presto/config xuxinkub/kubesql:latest
docker run -it -d --name kubesql -v /root/.kube/config:/home/presto/config xuxinkun/kubesql:latest
docker exec -it kubesql presto --server localhost:8080 --catalog kubesql --schema kubesql
```

## example

```
[root@localhost kubesql]# docker run -it -d --name kubesql -v /root/.kube/config:/home/presto/config xuxinkun/kubesql:latest
[root@localhost kubesql]# docker exec -it kubesql presto --server localhost:8080 --catalog kubesql --schema kubesql
presto:kubesql> show tables;
Table
Expand Down
2 changes: 1 addition & 1 deletion etc/log.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
com.facebook.presto=DEBUG
com.facebook.presto=INFO
24 changes: 12 additions & 12 deletions src/main/java/io/kubesql/presto/kube/KubeCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,23 @@ public KubeCache(io.kubesql.presto.kube.KubeConfig config, KubeTables kubeTables
new ResourceEventHandler<V1Node>() {
@Override
public void onAdd(V1Node node) {
log.info("Receive node add event from %s", node.getMetadata().getName());
log.debug("Receive node add event from %s", node.getMetadata().getName());
kubeNodeTable.updateCache(node);
log.info("Handle node add event from %s", node.getMetadata().getName());
log.debug("Handle node add event from %s", node.getMetadata().getName());
}

@Override
public void onUpdate(V1Node oldNode, V1Node newNode) {
log.info("Receive node update event from %s", newNode.getMetadata().getName());
log.debug("Receive node update event from %s", newNode.getMetadata().getName());
kubeNodeTable.updateCache(newNode);
log.info("Handle node update event from %s", newNode.getMetadata().getName());
log.debug("Handle node update event from %s", newNode.getMetadata().getName());
}

@Override
public void onDelete(V1Node node, boolean deletedFinalStateUnknown) {
log.info("Receive node delete event from %s", node.getMetadata().getName());
log.debug("Receive node delete event from %s", node.getMetadata().getName());
kubeNodeTable.removeCache(node);
log.info("Handle node delete event from %s", node.getMetadata().getName());
log.debug("Handle node delete event from %s", node.getMetadata().getName());
}
});

Expand Down Expand Up @@ -130,23 +130,23 @@ public void onDelete(V1Node node, boolean deletedFinalStateUnknown) {
new ResourceEventHandler<V1Pod>() {
@Override
public void onAdd(V1Pod pod) {
log.info("Receive pod add event from %s", pod.getMetadata().getName());
log.debug("Receive pod add event from %s", pod.getMetadata().getName());
kubePodTable.updateCache(pod);
log.info("Handle pod add event from %s", pod.getMetadata().getName());
log.debug("Handle pod add event from %s", pod.getMetadata().getName());
}

@Override
public void onUpdate(V1Pod oldpod, V1Pod newpod) {
log.info("Receive pod update event from %s", newpod.getMetadata().getName());
log.debug("Receive pod update event from %s", newpod.getMetadata().getName());
kubePodTable.updateCache(newpod);
log.info("Handle pod update event from %s", newpod.getMetadata().getName());
log.debug("Handle pod update event from %s", newpod.getMetadata().getName());
}

@Override
public void onDelete(V1Pod pod, boolean deletedFinalStateUnknown) {
log.info("Receive pod delete event from %s", pod.getMetadata().getName());
log.debug("Receive pod delete event from %s", pod.getMetadata().getName());
kubePodTable.removeCache(pod);
log.info("Handle pod delete event from %s", pod.getMetadata().getName());
log.debug("Handle pod delete event from %s", pod.getMetadata().getName());
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/kubesql/presto/kube/KubeTables.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public List<SchemaTableName> getTables()
public List<ColumnMetadata> getColumns(KubeTableHandle tableHandle)
{
checkArgument(tableColumns.containsKey(tableHandle.getSchemaTableName()), "Table %s not registered", tableHandle.getSchemaTableName());
log.info(tableColumns.get(tableHandle.getSchemaTableName()).toString());
log.debug("get columns %s", tableColumns.get(tableHandle.getSchemaTableName()).toString());
return tableColumns.get(tableHandle.getSchemaTableName());
}
}

0 comments on commit 6e1142a

Please sign in to comment.