use of io.crate.metadata.Reference in project crate by crate.
the class SysNodesExpressionsOnHandlerTest method testNetwork.
@Test
public void testNetwork() throws Exception {
Reference refInfo = refInfo("sys.nodes.network", DataTypes.OBJECT, RowGranularity.NODE);
collectExpression = resolver.getImplementation(refInfo);
collectExpression.setNextRow(CONTEXT);
Map<String, Object> networkStats = (Map<String, Object>) collectExpression.value();
assertThat(mapToSortedString(networkStats), is("probe_timestamp=0, tcp={" + "connections={accepted=42, curr_established=42, dropped=42, embryonic_dropped=42, initiated=42}, " + "packets={errors_received=42, received=42, retransmitted=42, rst_sent=42, sent=42}" + "}"));
}
use of io.crate.metadata.Reference in project crate by crate.
the class SysNodesExpressionsOnHandlerTest method testId.
@Test
public void testId() throws Exception {
Reference refInfo = refInfo("sys.nodes.id", DataTypes.STRING, RowGranularity.NODE);
collectExpression = resolver.getImplementation(refInfo);
collectExpression.setNextRow(CONTEXT);
assertThat(BytesRefs.toBytesRef("93c7ff92-52fa-11e6-aad8-3c15c2d3ad18"), is(collectExpression.value()));
}
use of io.crate.metadata.Reference in project crate by crate.
the class SysNodesExpressionsOnHandlerTest method testOsInfo.
@Test
public void testOsInfo() throws Exception {
Reference refInfo = refInfo("sys.nodes.os_info", DataTypes.OBJECT, RowGranularity.NODE);
collectExpression = resolver.getImplementation(refInfo);
collectExpression.setNextRow(CONTEXT);
Map<String, Object> v = (Map<String, Object>) collectExpression.value();
assertThat(v.get("available_processors"), is(4));
}
use of io.crate.metadata.Reference in project crate by crate.
the class SysNodesExpressionsOnHandlerTest method testPorts.
@Test
public void testPorts() throws Exception {
Reference refInfo = refInfo("sys.nodes.port", DataTypes.OBJECT, RowGranularity.NODE);
collectExpression = resolver.getImplementation(refInfo);
collectExpression.setNextRow(CONTEXT);
Map<String, Object> v = (Map<String, Object>) collectExpression.value();
assertThat(v.get("http"), is(4200));
assertThat(v.get("transport"), is(4300));
}
use of io.crate.metadata.Reference in project crate by crate.
the class SysNodesExpressionsOnHandlerTest method testVersion.
@Test
public void testVersion() throws Exception {
Reference refInfo = refInfo("sys.nodes.version", DataTypes.OBJECT, RowGranularity.NODE);
collectExpression = resolver.getImplementation(refInfo);
collectExpression.setNextRow(CONTEXT);
Map<String, Object> v = (Map<String, Object>) collectExpression.value();
assertThat(v.get("number"), is(Version.CURRENT.number()));
assertThat(v.get("build_hash"), is(Build.CURRENT.hash()));
assertThat(v.get("build_snapshot"), is(Version.CURRENT.snapshot()));
}
Aggregations