Exemplo n.º 1
0
  public void updateClusterConfiguration(final byte[] iContent) {
    if (iContent == null) return;

    synchronized (clusterConfiguration) {
      clusterConfiguration.reset();

      // UPDATE IT
      clusterConfiguration.fromStream(iContent);

      if (OLogManager.instance().isDebugEnabled())
        OLogManager.instance()
            .debug(this, "Received new cluster configuration: %s", clusterConfiguration.toJSON(""));
    }
  }
Exemplo n.º 2
0
  protected Map<Object, Object> deserializeQueryParameters(final byte[] paramBuffer) {
    if (paramBuffer == null || paramBuffer.length == 0) return Collections.emptyMap();

    final ODocument param = new ODocument();
    param.fromStream(paramBuffer);
    param.setFieldType("params", OType.EMBEDDEDMAP);
    final Map<String, Object> params = param.rawField("params");

    final Map<Object, Object> result = new HashMap<Object, Object>();
    for (Entry<String, Object> p : params.entrySet()) {
      if (Character.isDigit(p.getKey().charAt(0)))
        result.put(Integer.parseInt(p.getKey()), p.getValue());
      else result.put(p.getKey(), p.getValue());
    }
    return result;
  }