-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c182634
commit 5288aad
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
hoptimator-k8s/src/main/java/com/linkedin/hoptimator/k8s/K8sPipelineTable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.linkedin.hoptimator.k8s; | ||
|
||
import org.apache.calcite.schema.Schema; | ||
|
||
import com.linkedin.hoptimator.k8s.models.V1alpha1Pipeline; | ||
import com.linkedin.hoptimator.k8s.models.V1alpha1PipelineList; | ||
import com.linkedin.hoptimator.k8s.models.V1alpha1PipelineSpec; | ||
|
||
|
||
public class K8sPipelineTable extends K8sTable<V1alpha1Pipeline, V1alpha1PipelineList, K8sPipelineTable.Row> { | ||
|
||
// CHECKSTYLE:OFF | ||
public static class Row { | ||
public String NAME; | ||
public String STATUS; | ||
|
||
public Row(String name, String status) { | ||
this.NAME = name; | ||
this.STATUS = status; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.join("\t", NAME, STATUS); | ||
} | ||
} | ||
// CHECKSTYLE:ON | ||
|
||
public K8sPipelineTable(K8sContext context) { | ||
super(context, K8sApiEndpoints.PIPELINES, Row.class); | ||
} | ||
|
||
@Override | ||
public Row toRow(V1alpha1Pipeline obj) { | ||
return new Row(obj.getMetadata().getName(), obj.getStatus().getMessage()); | ||
} | ||
|
||
@Override | ||
public Schema.TableType getJdbcTableType() { | ||
return Schema.TableType.SYSTEM_TABLE; | ||
} | ||
} |