Package io.crate.metadata

Examples of io.crate.metadata.ReferenceIdent


                        "}"));
    }

    @Test
    public void testNetworkTCP() throws Exception {
        ReferenceIdent ident = new ReferenceIdent(SysNodesTableInfo.IDENT, "network", Arrays.asList("tcp"));
        SysObjectReference tcpRef = (SysObjectReference) resolver.getImplementation(ident);

        Map<String, Object> tcpStats = tcpRef.value();

        assertThat(tcpStats, instanceOf(Map.class));
View Full Code Here


    }


    @Test
    public void testCpu() throws Exception {
        ReferenceIdent ident = new ReferenceIdent(SysNodesTableInfo.IDENT, "os");
        SysObjectReference os = (SysObjectReference)resolver.getImplementation(ident);

        Map<String, Object> v = os.value();
        assertEquals(3600000L, v.get("uptime"));
View Full Code Here

        assertEquals(cpuObj, v.get("cpu"));
    }

    @Test
    public void testProcess() throws Exception {
        ReferenceIdent ident = new ReferenceIdent(SysNodesTableInfo.IDENT, "process");
        SysObjectReference processRef = (SysObjectReference)resolver.getImplementation(ident);

        Map<String, Object> v = processRef.value();
        assertEquals(42L, (long) v.get("open_file_descriptors"));
        assertEquals(1000L, (long) v.get("max_open_file_descriptors"));
View Full Code Here

        assertEquals(1000L, (long) v.get("max_open_file_descriptors"));
    }

    @Test
    public void testNestedBytesRefExpressionsString() throws Exception {
        ReferenceIdent ident = new ReferenceIdent(SysNodesTableInfo.IDENT, "version");
        SysObjectReference version = (SysObjectReference) resolver.getImplementation(ident);

        ident = new ReferenceIdent(SysNodesTableInfo.IDENT, "version", Arrays.asList("number"));
        SysNodeExpression<BytesRef> versionNumber = (SysNodeExpression<BytesRef>)resolver.getImplementation(ident);

        assertThat(version.value().get(NodeVersionExpression.NUMBER), instanceOf(String.class));
        assertThat(versionNumber.value(), is(new BytesRef(version.value().get(NodeVersionExpression.NUMBER).toString())));
View Full Code Here

            childImplementations.add(new NullFieldSysObjectReference());
        }

        @Override
        public ReferenceInfo info() {
            return new ReferenceInfo(new ReferenceIdent(new TableIdent("bla", "blubb"), "foo"), RowGranularity.DOC, new ArrayType(DataTypes.STRING));
        }
View Full Code Here

            return null;
        }

        @Override
        public ReferenceInfo info() {
            return new ReferenceInfo(new ReferenceIdent(new TableIdent("bla", "blubb"), "foo"), RowGranularity.DOC, DataTypes.STRING);
        }
View Full Code Here

            childImplementations.put("n", new BytesRefNullSysExpression());
        }

        @Override
        public ReferenceInfo info() {
            return new ReferenceInfo(new ReferenceIdent(new TableIdent("bla", "blubb"), "foo"), RowGranularity.DOC, DataTypes.OBJECT);
        }
View Full Code Here

TOP

Related Classes of io.crate.metadata.ReferenceIdent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.