org.apache.activemq.command.Message.getMemoryUsage()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(214)

本文整理了Java中org.apache.activemq.command.Message.getMemoryUsage()方法的一些代码示例,展示了Message.getMemoryUsage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getMemoryUsage()方法的具体详情如下:
包路径:org.apache.activemq.command.Message
类名称:Message
方法名:getMemoryUsage

Message.getMemoryUsage介绍

暂无

代码示例

代码示例来源:origin: apache/activemq

@Override
public int incrementReferenceCount() {
  int rc;
  int size;
  synchronized (this) {
    rc = ++referenceCount;
    size = getSize();
  }
  if (rc == 1 && getMemoryUsage() != null) {
    getMemoryUsage().increaseUsage(size);
    //System.err.println("INCREASE USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage());
  }
  //System.out.println(" + "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc);
  return rc;
}

代码示例来源:origin: apache/activemq

@Override
public int decrementReferenceCount() {
  int rc;
  int size;
  synchronized (this) {
    rc = --referenceCount;
    size = getSize();
  }
  if (rc == 0 && getMemoryUsage() != null) {
    getMemoryUsage().decreaseUsage(size);
    //Thread.dumpStack();
    //System.err.println("DECREADED USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage());
  }
  //System.out.println(" - "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc);
  return rc;
}

代码示例来源:origin: apache/activemq

public PendingMarshalUsageTracker(final Message message) {
  usage = message.getMemoryUsage();
  if (usage != null) {
    messageSize = message.getSize();
    usage.increaseUsage(messageSize);
  }
}

代码示例来源:origin: apache/activemq

if (recordUniqueId(message.getMessageId())) {
  if (!cached) {
    if( message.getMemoryUsage()==null ) {
      message.setMemoryUsage(this.getSystemUsage().getMemoryUsage());

代码示例来源:origin: pierre/meteo

public int incrementReferenceCount() {
  int rc;
  int size;
  synchronized (this) {
    rc = ++referenceCount;
    size = getSize();
  }
  if (rc == 1 && getMemoryUsage() != null) {
    getMemoryUsage().increaseUsage(size);
    //System.err.println("INCREASE USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage());
  }
  //System.out.println(" + "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc);
  return rc;
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public int incrementReferenceCount() {
  int rc;
  int size;
  synchronized (this) {
    rc = ++referenceCount;
    size = getSize();
  }
  if (rc == 1 && getMemoryUsage() != null) {
    getMemoryUsage().increaseUsage(size);
    //System.err.println("INCREASE USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage());
  }
  //System.out.println(" + "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc);
  return rc;
}

代码示例来源:origin: org.apache.activemq/activemq-client

@Override
public int incrementReferenceCount() {
  int rc;
  int size;
  synchronized (this) {
    rc = ++referenceCount;
    size = getSize();
  }
  if (rc == 1 && getMemoryUsage() != null) {
    getMemoryUsage().increaseUsage(size);
    //System.err.println("INCREASE USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage());
  }
  //System.out.println(" + "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc);
  return rc;
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public int decrementReferenceCount() {
  int rc;
  int size;
  synchronized (this) {
    rc = --referenceCount;
    size = getSize();
  }
  if (rc == 0 && getMemoryUsage() != null) {
    getMemoryUsage().decreaseUsage(size);
    //Thread.dumpStack();
    //System.err.println("DECREADED USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage());
  }
  //System.out.println(" - "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc);
  return rc;
}

代码示例来源:origin: org.apache.activemq/activemq-client

@Override
public int decrementReferenceCount() {
  int rc;
  int size;
  synchronized (this) {
    rc = --referenceCount;
    size = getSize();
  }
  if (rc == 0 && getMemoryUsage() != null) {
    getMemoryUsage().decreaseUsage(size);
    //Thread.dumpStack();
    //System.err.println("DECREADED USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage());
  }
  //System.out.println(" - "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc);
  return rc;
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public int decrementReferenceCount() {
  int rc;
  int size;
  synchronized (this) {
    rc = --referenceCount;
    size = getSize();
  }
  if (rc == 0 && getMemoryUsage() != null) {
    getMemoryUsage().decreaseUsage(size);
    //Thread.dumpStack();
    //System.err.println("DECREADED USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage());
  }
  //System.out.println(" - "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc);
  return rc;
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public int incrementReferenceCount() {
  int rc;
  int size;
  synchronized (this) {
    rc = ++referenceCount;
    size = getSize();
  }
  if (rc == 1 && getMemoryUsage() != null) {
    getMemoryUsage().increaseUsage(size);
    //System.err.println("INCREASE USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage());
  }
  //System.out.println(" + "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc);
  return rc;
}

代码示例来源:origin: pierre/meteo

public int decrementReferenceCount() {
  int rc;
  int size;
  synchronized (this) {
    rc = --referenceCount;
    size = getSize();
  }
  if (rc == 0 && getMemoryUsage() != null) {
    getMemoryUsage().decreaseUsage(size);
    //Thread.dumpStack();
    //System.err.println("DECREADED USAGE " + System.identityHashCode(getMemoryUsage()) + " PERCENT = " + getMemoryUsage().getPercentUsage());
  }
  //System.out.println(" - "+getMemoryUsage().getName()+" :::: "+getMessageId()+"rc="+rc);
  return rc;
}

代码示例来源:origin: org.apache.activemq/activemq-broker

public PendingMarshalUsageTracker(final Message message) {
  usage = message.getMemoryUsage();
  if (usage != null) {
    messageSize = message.getSize();
    usage.increaseUsage(messageSize);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-all

public PendingMarshalUsageTracker(final Message message) {
  usage = message.getMemoryUsage();
  if (usage != null) {
    messageSize = message.getSize();
    usage.increaseUsage(messageSize);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

public PendingMarshalUsageTracker(final Message message) {
  usage = message.getMemoryUsage();
  if (usage != null) {
    messageSize = message.getSize();
    usage.increaseUsage(messageSize);
  }
}

代码示例来源:origin: pierre/meteo

public synchronized boolean recoverMessage(Message message, boolean cached) throws Exception {
  boolean recovered = false;
  if (recordUniqueId(message.getMessageId())) {
    if (!cached) {
      message.setRegionDestination(regionDestination);
      if( message.getMemoryUsage()==null ) {
        message.setMemoryUsage(this.getSystemUsage().getMemoryUsage());
      }
    }
    message.incrementReferenceCount();
    batchList.addMessageLast(message);
    clearIterator(true);
    recovered = true;
    storeHasMessages = true;
  } else {
    /*
     * we should expect to get these - as the message is recorded as it before it goes into
     * the cache. If subsequently, we pull out that message from the store (before its deleted)
     * it will be a duplicate - but should be ignored
     */
    if (LOG.isTraceEnabled()) {
      LOG.trace(this + " - cursor got duplicate: " + message.getMessageId() + ", " + message.getPriority());
    }
  }
  return recovered;
}

代码示例来源:origin: org.apache.activemq/activemq-all

if (recordUniqueId(message.getMessageId())) {
  if (!cached) {
    if( message.getMemoryUsage()==null ) {
      message.setMemoryUsage(this.getSystemUsage().getMemoryUsage());

代码示例来源:origin: org.apache.activemq/activemq-broker

if (recordUniqueId(message.getMessageId())) {
  if (!cached) {
    if( message.getMemoryUsage()==null ) {
      message.setMemoryUsage(this.getSystemUsage().getMemoryUsage());

代码示例来源:origin: org.apache.activemq/activemq-osgi

if (recordUniqueId(message.getMessageId())) {
  if (!cached) {
    if( message.getMemoryUsage()==null ) {
      message.setMemoryUsage(this.getSystemUsage().getMemoryUsage());

相关文章

Message类方法