Examples of PyTuple


Examples of org.python.core.PyTuple

                    .append(metricName)
                    .append(".")
                    .append(valueName)
                    .toString();
            }
            PyTuple tuple = new PyTuple(new PyString(metricName),
                new PyTuple(new PyLong(timestamp), new PyString(value)));
            metrics.add(tuple);
            if(metrics.size() >= batchSize) {
                writeMetrics();
            }
        }
View Full Code Here

Examples of org.python.core.PyTuple

        private static Map<String, String> getModuleState() {
            // determine the current module state
            Map<String, String> files = new HashMap<String, String>();
            PyStringMap modules = (PyStringMap) Py.getSystemState().modules;
            for (PyObject kvp : modules.iteritems().asIterable()) {
                PyTuple tuple = (PyTuple) kvp;
                String name = tuple.get(0).toString();
                Object value = tuple.get(1);
                // inspect the module to determine file location and status
                try {
                    Object fileEntry = null;
                    Object loader = null;
                    if (value instanceof PyJavaPackage ) {
View Full Code Here

Examples of org.python.core.PyTuple

            if (!prefix.isEmpty()) {
                metricName.insert(0, prefix);
            }
            metricName.append(".").append(valueName);

            PyTuple tuple = new PyTuple(new PyString(metricName.toString()),
                new PyTuple(new PyLong(timestamp), new PyString(value)));
            metrics.add(tuple);
            if(metrics.size() >= batchSize) {
                writeMetrics();
            }
        }
View Full Code Here

Examples of org.python.core.PyTuple

                    .append(metricName)
                    .append(".")
                    .append(valueName)
                    .toString();
            }
            PyTuple tuple = new PyTuple(new PyString(metricName),
                new PyTuple(new PyLong(timestamp), new PyString(value)));
            metrics.add(tuple);
            if(metrics.size() >= batchSize) {
                writeMetrics();
            }
        }
View Full Code Here

Examples of org.python.core.PyTuple

        try {
            Object javaObj = null;
            // Add code for all supported pig types here
            // Tuple, bag, map, int, long, float, double, chararray, bytearray
            if (pyObject instanceof PyTuple) {
                PyTuple pyTuple = (PyTuple) pyObject;
                Object[] tuple = new Object[pyTuple.size()];
                int i = 0;
                for (PyObject tupleObject : pyTuple.getArray()) {
                    tuple[i++] = pythonToPig(tupleObject);
                }
                javaObj = tupleFactory.newTuple(Arrays.asList(tuple));
            } else if (pyObject instanceof PyList) {
                DataBag list = bagFactory.newDefaultBag();
View Full Code Here

Examples of org.python.core.PyTuple

        PyObject[] pyTuple = new PyObject[tuple.size()];
        int i = 0;
        for (Object object : tuple.getAll()) {
            pyTuple[i++] = pigToPython(object);
        }
        return new PyTuple(pyTuple);
    }
View Full Code Here

Examples of org.python.core.PyTuple

        private static Map<String, String> getModuleState() {
            // determine the current module state
            Map<String, String> files = new HashMap<String, String>();
            PyStringMap modules = (PyStringMap) Py.getSystemState().modules;
            for (PyObject kvp : modules.iteritems().asIterable()) {
                PyTuple tuple = (PyTuple) kvp;
                String name = tuple.get(0).toString();
                Object value = tuple.get(1);

                // inspect the module to determine file location and status
                try {
                    Object fileEntry = null;
                    if (value instanceof PyJavaPackage ) {
View Full Code Here

Examples of org.python.core.PyTuple

    public static PyTuple lookup(String encoding) {
        return codecs.lookup(encoding);
    }

    private static PyTuple decode_tuple(String s, int len) {
        return new PyTuple(new PyObject[] { new PyUnicode(s), Py.newInteger(len) });
    }
View Full Code Here

Examples of org.python.core.PyTuple

    private static PyTuple decode_tuple(String s, int len) {
        return new PyTuple(new PyObject[] { new PyUnicode(s), Py.newInteger(len) });
    }

    private static PyTuple encode_tuple(String s, int len) {
        return new PyTuple(new PyObject[] { Py.java2py(s), Py.newInteger(len) });
    }
View Full Code Here

Examples of org.python.core.PyTuple

    }

    public static PyTuple utf_16_ex_decode(String str, String errors, int byteorder) {
        int[] bo = new int[] { 0 };
        String s = decode_UTF16(str, errors, bo);
        return new PyTuple(new PyObject[] { Py.newString(s), Py.newInteger(str.length()), Py.newInteger(bo[0]) });
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.