public OChannelBinary writeByte(final byte iContent) throws IOException { if (debug) OLogManager.instance().info(this, "%s - Writing byte (1 byte): %d", socket.getRemoteSocketAddress(), iContent); out.write(iContent); updateMetricTransmittedBytes(OBinaryProtocol.SIZE_BYTE); return this; }
/** * Return the type by ID. * * @param iId The id to search * * @return The type if any, otherwise null */ public static OType getById(final byte iId) { if (iId >= 0 && iId < TYPES_BY_ID.length) return TYPES_BY_ID[iId]; OLogManager.instance().warn(OType.class, "Invalid type index: " + iId, (Object[]) null); return null; }
private void startupIfEnginesAreMissing() { // Using a jdk which doesn't bundle a javascript engine // throws a NoClassDefFoundError while logging the warning // see https://github.com/orientechnologies/orientdb/issues/5855 OLogManager.instance().setWarnEnabled(false); // If an instance of Orient was previously shutdown all engines are removed. // We need to startup Orient again. if (Orient.instance().getEngines().isEmpty()) { Orient.instance().startup(); } OLogManager.instance().setWarnEnabled(true); }
public void errorStorage(final Object iRequester, final String iMessage, final Throwable iException, final Object... iAdditionalArgs) { if (isErrorEnabled()) log(iRequester, Level.SEVERE, iMessage, iException, false, LogLabel.STORAGE_LOGGING, iAdditionalArgs); }
public void debugNoDb(final Object iRequester, final String iMessage, final Throwable iException, final Object... iAdditionalArgs) { if (isDebugEnabled()) log(iRequester, Level.FINE, iMessage, iException, false, null, iAdditionalArgs); }
public int readInt() throws IOException { updateMetricReceivedBytes(OBinaryProtocol.SIZE_INT); if (debug) { OLogManager.instance().info(this, "%s - Reading int (4 bytes)...", socket.getRemoteSocketAddress()); final int value = in.readInt(); OLogManager.instance().info(this, "%s - Read int: %d", socket.getRemoteSocketAddress(), value); return value; } return in.readInt(); }
@Override public void flush() throws IOException { if (debug) OLogManager.instance() .info(this, "%s - Flush", socket != null ? " null possible previous close" : socket.getRemoteSocketAddress()); updateMetricFlushes(); if (out != null) // IT ALREADY CALL THE UNDERLYING FLUSH out.flush(); else super.flush(); }
public OChannelBinary writeInt(final int iContent) throws IOException { if (debug) OLogManager.instance().info(this, "%s - Writing int (4 bytes): %d", socket.getRemoteSocketAddress(), iContent); out.writeInt(iContent); updateMetricTransmittedBytes(OBinaryProtocol.SIZE_INT); return this; }
public long readLong() throws IOException { updateMetricReceivedBytes(OBinaryProtocol.SIZE_LONG); if (debug) { OLogManager.instance().info(this, "%s - Reading long (8 bytes)...", socket.getRemoteSocketAddress()); final long value = in.readLong(); OLogManager.instance().info(this, "%s - Read long: %d", socket.getRemoteSocketAddress(), value); return value; } return in.readLong(); }
public byte readByte() throws IOException { updateMetricReceivedBytes(OBinaryProtocol.SIZE_BYTE); if (debug) { OLogManager.instance().info(this, "%s - Reading byte (1 byte)...", socket.getRemoteSocketAddress()); final byte value = in.readByte(); OLogManager.instance().info(this, "%s - Read byte: %d", socket.getRemoteSocketAddress(), (int) value); return value; } return in.readByte(); }
public short readShort() throws IOException { updateMetricReceivedBytes(OBinaryProtocol.SIZE_SHORT); if (debug) { OLogManager.instance().info(this, "%s - Reading short (2 bytes)...", socket.getRemoteSocketAddress()); final short value = in.readShort(); OLogManager.instance().info(this, "%s - Read short: %d", socket.getRemoteSocketAddress(), value); return value; } return in.readShort(); }
public OChannelBinary writeLong(final long iContent) throws IOException { if (debug) OLogManager.instance().info(this, "%s - Writing long (8 bytes): %d", socket.getRemoteSocketAddress(), iContent); out.writeLong(iContent); updateMetricTransmittedBytes(OBinaryProtocol.SIZE_LONG); return this; }
public OChannelBinary writeBoolean(final boolean iContent) throws IOException { if (debug) OLogManager.instance().info(this, "%s - Writing boolean (1 byte): %b", socket.getRemoteSocketAddress(), iContent); out.writeBoolean(iContent); updateMetricTransmittedBytes(OBinaryProtocol.SIZE_BYTE); return this; }
public OChannelBinary writeShort(final short iContent) throws IOException { if (debug) OLogManager.instance().info(this, "%s - Writing short (2 bytes): %d", socket.getRemoteSocketAddress(), iContent); out.writeShort(iContent); updateMetricTransmittedBytes(OBinaryProtocol.SIZE_SHORT); return this; }
public boolean readBoolean() throws IOException { updateMetricReceivedBytes(OBinaryProtocol.SIZE_BYTE); if (debug) { OLogManager.instance().info(this, "%s - Reading boolean (1 byte)...", socket.getRemoteSocketAddress()); final boolean value = in.readBoolean(); OLogManager.instance().info(this, "%s - Read boolean: %b", socket.getRemoteSocketAddress(), value); return value; } return in.readBoolean(); }
if (iFieldValue == null) { OLogManager.instance() .debug(this, "Edge not found in vertex's property %s.%s while removing the edge %s", iVertex.getIdentity(), iFieldName, iEdge.getIdentity()); return false; iVertex.removeField(iFieldName); else { OLogManager.instance() .warn(this, "Edge not found in vertex's property %s.%s link while removing the edge %s", iVertex.getIdentity(), iFieldName, iEdge.getIdentity()); return false; OLogManager.instance() .warn(this, "Edge not found in vertex's property %s.%s set while removing the edge %s", iVertex.getIdentity(), iFieldName, iEdge.getIdentity()); return false;
outVertexRecord = outVertex.getRecord(); if (outVertexRecord != null) { final String outFieldName = OrientVertex .getConnectionFieldName(Direction.OUT, edgeClassName, useVertexFieldsForEdgeLabels); outVertexChanged = edge .dropEdgeFromVertex(inVertexEdge, outVertexRecord, outFieldName, outVertexRecord.field(outFieldName)); } else OLogManager.instance().debug(graph, "Found broken link to outgoing vertex " + outVertex.getIdentity() + " while removing edge " + edge.getId()); inVertexRecord = inVertex.getRecord(); if (inVertexRecord != null) { final String inFieldName = OrientVertex .getConnectionFieldName(Direction.IN, edgeClassName, useVertexFieldsForEdgeLabels); inVertexChanged = edge .dropEdgeFromVertex(outVertexEdge, inVertexRecord, inFieldName, inVertexRecord.field(inFieldName)); } else OLogManager.instance().debug(graph, "Found broken link to incoming vertex " + inVertex.getIdentity() + " while removing edge " + edge.getId()); outVertexRecord.save(); if (inVertexChanged) inVertexRecord.save(); throw e; } catch (Exception e) { throw OException.wrapException(new OrientGraphModificationException("Error on addEdge in non tx environment"), e);
.field(iFieldName) : iVertex.removeField(iFieldName); if (fieldValue == null) return; iVertex.removeField(iFieldName); for (OLazyIterator<OIdentifiable> it = ((OMVRBTreeRIDSet) fieldValue) .iterator(false); it.hasNext();) { final ODocument curr = it.next().getRecord(); .instance() .warn(null, "[OrientVertex.removeEdges] edge %s not found in field %s", iVertexToRemove, iFieldName);
private Object executeUnsubscribe() { try { OLiveQueryHook.unsubscribe(Integer.parseInt(unsubscribeToken), getDatabase()); ODocument result = new ODocument(); result.field("unsubscribed", unsubscribeToken); result.field("unsubscribe", true); result.field("token", unsubscribeToken); return result; } catch (Exception e) { OLogManager.instance().warn(this, "error unsubscribing token " + unsubscribeToken + ": " + e.getClass().getName() + " - " + e.getMessage()); ODocument result = new ODocument(); result.field("error-unsubscribe", unsubscribeToken); result.field("error-description", e.getMessage()); result.field("error-type", e.getClass().getName()); return result; } }