當前位置: 首頁>>代碼示例>>Java>>正文


Java UnsafeDirectLittleEndian類代碼示例

本文整理匯總了Java中io.netty.buffer.UnsafeDirectLittleEndian的典型用法代碼示例。如果您正苦於以下問題:Java UnsafeDirectLittleEndian類的具體用法?Java UnsafeDirectLittleEndian怎麽用?Java UnsafeDirectLittleEndian使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UnsafeDirectLittleEndian類屬於io.netty.buffer包,在下文中一共展示了UnsafeDirectLittleEndian類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getSize

import io.netty.buffer.UnsafeDirectLittleEndian; //導入依賴的package包/類
public long getSize(ValueVector v, SizeType type){
  long size = 0;
  ArrowBuf[] buffers = v.getBuffers(false);
  for(ArrowBuf b : buffers){
    switch(type){
    case ACCOUNTED:
      size += b.getActualMemoryConsumed();
      break;
    case WORSE_CASE:
      UnsafeDirectLittleEndian udle = (UnsafeDirectLittleEndian) b.unwrap();
      // avoid counting the same underlying buffer multiple times
      if (accountedBuffers.containsKey(udle)) {
        continue;
      }
      size += b.getPossibleMemoryConsumed();
      accountedBuffers.put(udle, null);
      break;
    default:
      throw new UnsupportedOperationException("Invalid case: " + type.name());
    }
  }
  return size;
}
 
開發者ID:dremio,項目名稱:dremio-oss,代碼行數:24,代碼來源:BatchStats.java

示例2: dumpBuffers

import io.netty.buffer.UnsafeDirectLittleEndian; //導入依賴的package包/類
private void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet) {
  for (final BufferLedger ledger : ledgerSet) {
    if (!ledger.isOwningLedger()) {
      continue;
    }
    final UnsafeDirectLittleEndian udle = ledger.getUnderlying();
    sb.append("UnsafeDirectLittleEndian[dentityHashCode == ");
    sb.append(Integer.toString(System.identityHashCode(udle)));
    sb.append("] size ");
    sb.append(Integer.toString(udle.capacity()));
    sb.append('\n');
  }
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:14,代碼來源:BaseAllocator.java

示例3: getUnderlying

import io.netty.buffer.UnsafeDirectLittleEndian; //導入依賴的package包/類
/**
 * Package visible for debugging/verification only.
 */
@VisibleForTesting
protected UnsafeDirectLittleEndian getUnderlying() {
  return underlying;
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:8,代碼來源:AllocationManager.java

示例4: verifyAllocator

import io.netty.buffer.UnsafeDirectLittleEndian; //導入依賴的package包/類
/**
 * Verifies the accounting state of the allocator. Only works for DEBUG.
 *
 * @throws IllegalStateException
 *           when any problems are found
 */
void verifyAllocator() {
  final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen = new IdentityHashMap<>();
  verifyAllocator(buffersSeen);
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:11,代碼來源:BaseAllocator.java


注:本文中的io.netty.buffer.UnsafeDirectLittleEndian類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。