Skip to content

Commit

Permalink
TEIID-5574 working towards better property names
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Dec 19, 2018
1 parent 10a8a98 commit 9f74db9
Show file tree
Hide file tree
Showing 15 changed files with 729 additions and 102 deletions.
32 changes: 32 additions & 0 deletions admin/src/main/java/org/teiid/adminapi/EngineStatisticsBean.java
Expand Up @@ -29,15 +29,31 @@ public interface EngineStatisticsBean {
/**
* Total amount memory used by buffer manager for active queries and cached queries
* @return
* @see #getBufferHeapInUseKb()
*/
@Deprecated
long getTotalMemoryUsedInKB();

/**
* Heap memory estimate in use by buffer manager
* @return
*/
long getBufferHeapInUseKb();

/**
* Total memory used by buffer manager for active plans
* @return
* @see #getBufferHeapReservedByActivePlansKb()
*/
@Deprecated
long getMemoryUsedByActivePlansInKB();

/**
* Total processing memory reserved by active plans
* @return
*/
long getBufferHeapReservedByActivePlansKb();

/**
* Number of writes to disk by buffer manager to save the overflow from memory
* @return
Expand All @@ -53,15 +69,31 @@ public interface EngineStatisticsBean {
/**
* Total number of cache reads, includes disk and soft-cache references
* @return
* @see #getStorageReadCount();
*/
@Deprecated
long getCacheReadCount();

/**
* Total number of storage reads from the layer below the heap
* @return
*/
long getStorageReadCount();

/**
* Total number of cache writes, includes disk and soft-cache references
* @return
* @see #getStorageReadCount()
*/
@Deprecated
long getCacheWriteCount();

/**
* Total number of storage writes to the layer below the heap
* @return
*/
long getStorageWriteCount();

/**
* Disk space used by buffer manager to save overflowed memory contents
* @return
Expand Down
Expand Up @@ -149,4 +149,24 @@ public String toString() {
sb.append("; maxWaitPlanCount ").append(maxWaitPlanCount); //$NON-NLS-1$
return sb.toString();
}

@Override
public long getBufferHeapInUseKb() {
return totalMemoryUsedInKB;
}

@Override
public long getBufferHeapReservedByActivePlansKb() {
return memoryUsedByActivePlansInKB;
}

@Override
public long getStorageReadCount() {
return cacheReadCount;
}

@Override
public long getStorageWriteCount() {
return cacheWriteCount;
}
}
14 changes: 14 additions & 0 deletions jboss-integration/src/main/java/org/teiid/jboss/Element.java
Expand Up @@ -65,6 +65,20 @@ enum Element {
INLINE_LOBS("inline-lobs", "buffer-service-inline-lobs"),
ENCRYPT_FILES_ATTRIBUTE("encrypt-files", "buffer-service-encrypt-files"),

BUFFER_MANAGER_ELEMENT("buffer-manager"),
BUFFER_MANAGER_PROCESSOR_BATCH_SIZE_ATTRIBUTE("processor-batch-size", "buffer-manager-processor-batch-size"),
BUFFER_MANAGER_INLINE_LOBS("inline-lobs", "buffer-manager-inline-lobs"),
BUFFER_MANAGER_MAX_PROCESSING_KB_ATTRIBUTE("heap-max-processing-kb", "buffer-manager-heap-max-processing-kb"),
BUFFER_MANAGER_MAX_RESERVED_MB_ATTRIBUTE("heap-max-reserve-mb", "buffer-manager-heap-max-reserve-mb"),
BUFFER_MANAGER_USE_DISK_ATTRIBUTE("storage-enabled", "buffer-manager-storage-enabled"),
BUFFER_MANAGER_MAX_STORAGE_OBJECT_SIZE_ATTRIBUTE("storage-max-object-size", "buffer-manager-storage-max-object-size"),
BUFFER_MANAGER_MEMORY_BUFFER_SPACE_ATTRIBUTE("fixed-memory-space-mb", "buffer-manager-fixed-memory-space-mb"),
BUFFER_MANAGER_MEMORY_BUFFER_OFFHEAP_ATTRIBUTE("fixed-memory-off-heap", "buffer-manager-fixed-memory-off-heap"),
BUFFER_MANAGER_MAX_FILE_SIZE_ATTRIBUTE("disk-max-file-size", "buffer-manager-disk-max-file-size"),
BUFFER_MANAGER_MAX_BUFFER_SPACE_ATTRIBUTE("disk-max-space-mb", "buffer-manager-disk-max-space-mb"),
BUFFER_MANAGER_MAX_OPEN_FILES_ATTRIBUTE("disk-max-open-files", "buffer-manager-disk-max-open-files"),
BUFFER_MANAGER_ENCRYPT_FILES_ATTRIBUTE("disk-encrypt-files", "buffer-manager-disk-encrypt-files"),

//prepared-plan-cache-config
PREPAREDPLAN_CACHE_ELEMENT("preparedplan-cache"),
PPC_ENABLE_ATTRIBUTE("enable", "preparedplan-cache-enable"),
Expand Down
Expand Up @@ -24,12 +24,13 @@
enum Namespace {
// must be first
UNKNOWN(null),
TEIID_1_1("urn:jboss:domain:teiid:1.1"); //$NON-NLS-1$
TEIID_1_1("urn:jboss:domain:teiid:1.1"), //$NON-NLS-1$
TEIID_1_2("urn:jboss:domain:teiid:1.2"); //$NON-NLS-1$

/**
* The current namespace version.
*/
public static final Namespace CURRENT = TEIID_1_1;
public static final Namespace CURRENT = TEIID_1_2;

private final String uri;

Expand Down
14 changes: 7 additions & 7 deletions jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
Expand Up @@ -151,7 +151,7 @@ class TeiidAdd extends AbstractAddStepHandler {
TeiidConstants.INLINE_LOBS,
TeiidConstants.PROCESSOR_BATCH_SIZE_ATTRIBUTE,
TeiidConstants.MAX_PROCESSING_KB_ATTRIBUTE,
TeiidConstants.MAX_RESERVED_KB_ATTRIBUTE,
TeiidConstants.MAX_RESERVED_MB_ATTRIBUTE,
TeiidConstants.MAX_FILE_SIZE_ATTRIBUTE,
TeiidConstants.MAX_BUFFER_SPACE_ATTRIBUTE,
TeiidConstants.MAX_OPEN_FILES_ATTRIBUTE,
Expand Down Expand Up @@ -705,26 +705,26 @@ private BufferManagerService buildBufferManager(final OperationContext context,
if (isDefined(MAX_PROCESSING_KB_ATTRIBUTE, node, context)) {
bufferManger.setMaxProcessingKb(asInt(MAX_PROCESSING_KB_ATTRIBUTE, node, context));
}
if (isDefined(MAX_RESERVED_KB_ATTRIBUTE, node, context)) {
bufferManger.setMaxReserveKb(asInt(MAX_RESERVED_KB_ATTRIBUTE, node, context));
if (isDefined(MAX_RESERVED_MB_ATTRIBUTE, node, context)) {
bufferManger.setMaxReservedHeapMb(asInt(MAX_RESERVED_MB_ATTRIBUTE, node, context));
}
if (isDefined(MAX_FILE_SIZE_ATTRIBUTE, node, context)) {
bufferManger.setMaxFileSize(asLong(MAX_FILE_SIZE_ATTRIBUTE, node, context));
}
if (isDefined(MAX_BUFFER_SPACE_ATTRIBUTE, node, context)) {
bufferManger.setMaxBufferSpace(asLong(MAX_BUFFER_SPACE_ATTRIBUTE, node, context));
bufferManger.setMaxDiskBufferSpaceMb(asLong(MAX_BUFFER_SPACE_ATTRIBUTE, node, context));
}
if (isDefined(MAX_OPEN_FILES_ATTRIBUTE, node, context)) {
bufferManger.setMaxOpenFiles(asInt(MAX_OPEN_FILES_ATTRIBUTE, node, context));
}
if (isDefined(MEMORY_BUFFER_SPACE_ATTRIBUTE, node, context)) {
bufferManger.setMemoryBufferSpace(asInt(MEMORY_BUFFER_SPACE_ATTRIBUTE, node, context));
bufferManger.setFixedMemoryBufferSpaceMb(asInt(MEMORY_BUFFER_SPACE_ATTRIBUTE, node, context));
}
if (isDefined(MEMORY_BUFFER_OFFHEAP_ATTRIBUTE, node, context)) {
bufferManger.setMemoryBufferOffHeap(asBoolean(MEMORY_BUFFER_OFFHEAP_ATTRIBUTE, node, context));
bufferManger.setFixedMemoryBufferOffHeap(asBoolean(MEMORY_BUFFER_OFFHEAP_ATTRIBUTE, node, context));
}
if (isDefined(MAX_STORAGE_OBJECT_SIZE_ATTRIBUTE, node, context)) {
bufferManger.setMaxStorageObjectSize(asInt(MAX_STORAGE_OBJECT_SIZE_ATTRIBUTE, node, context));
bufferManger.setMaxStorageObjectSizeBytes(asInt(MAX_STORAGE_OBJECT_SIZE_ATTRIBUTE, node, context));
}
if (isDefined(INLINE_LOBS, node, context)) {
bufferManger.setInlineLobs(asBoolean(INLINE_LOBS, node, context));
Expand Down
50 changes: 25 additions & 25 deletions jboss-integration/src/main/java/org/teiid/jboss/TeiidConstants.java
Expand Up @@ -178,89 +178,89 @@ public class TeiidConstants {

// buffer manager
// BUFFER_SERVICE_ELEMENT("buffer-service",true, false, MeasurementUnit.NONE);
public static SimpleAttributeDefinition USE_DISK_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.USE_DISK_ATTRIBUTE.getModelName(), ModelType.BOOLEAN)
.setXmlName(Element.USE_DISK_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition USE_DISK_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_USE_DISK_ATTRIBUTE.getModelName(), ModelType.BOOLEAN)
.setXmlName(Element.BUFFER_MANAGER_USE_DISK_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(true))
.build();

public static SimpleAttributeDefinition PROCESSOR_BATCH_SIZE_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.PROCESSOR_BATCH_SIZE_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.PROCESSOR_BATCH_SIZE_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition PROCESSOR_BATCH_SIZE_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_PROCESSOR_BATCH_SIZE_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.BUFFER_MANAGER_PROCESSOR_BATCH_SIZE_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(256))
.build();

public static SimpleAttributeDefinition MAX_PROCESSING_KB_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.MAX_PROCESSING_KB_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.MAX_PROCESSING_KB_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition MAX_PROCESSING_KB_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_MAX_PROCESSING_KB_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.BUFFER_MANAGER_MAX_PROCESSING_KB_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(-1))
.setMeasurementUnit(MeasurementUnit.KILOBYTES)
.build();

public static SimpleAttributeDefinition MAX_RESERVED_KB_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.MAX_RESERVED_KB_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.MAX_RESERVED_KB_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition MAX_RESERVED_MB_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_MAX_RESERVED_MB_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.BUFFER_MANAGER_MAX_RESERVED_MB_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(-1))
.setMeasurementUnit(MeasurementUnit.KILOBYTES)
.setMeasurementUnit(MeasurementUnit.MEGABYTES)
.build();

public static SimpleAttributeDefinition MAX_FILE_SIZE_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.MAX_FILE_SIZE_ATTRIBUTE.getModelName(), ModelType.LONG)
.setXmlName(Element.MAX_FILE_SIZE_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition MAX_FILE_SIZE_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_MAX_FILE_SIZE_ATTRIBUTE.getModelName(), ModelType.LONG)
.setXmlName(Element.BUFFER_MANAGER_MAX_FILE_SIZE_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(2048))
.build();

public static SimpleAttributeDefinition MAX_BUFFER_SPACE_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.MAX_BUFFER_SPACE_ATTRIBUTE.getModelName(), ModelType.LONG)
.setXmlName(Element.MAX_BUFFER_SPACE_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition MAX_BUFFER_SPACE_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_MAX_BUFFER_SPACE_ATTRIBUTE.getModelName(), ModelType.LONG)
.setXmlName(Element.BUFFER_MANAGER_MAX_BUFFER_SPACE_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setMeasurementUnit(MeasurementUnit.MEGABYTES)
.build();

public static SimpleAttributeDefinition MAX_OPEN_FILES_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.MAX_OPEN_FILES_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.MAX_OPEN_FILES_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition MAX_OPEN_FILES_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_MAX_OPEN_FILES_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.BUFFER_MANAGER_MAX_OPEN_FILES_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(64))
.build();

public static SimpleAttributeDefinition MEMORY_BUFFER_SPACE_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.MEMORY_BUFFER_SPACE_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.MEMORY_BUFFER_SPACE_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition MEMORY_BUFFER_SPACE_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_MEMORY_BUFFER_SPACE_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.BUFFER_MANAGER_MEMORY_BUFFER_SPACE_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(-1))
.setMeasurementUnit(MeasurementUnit.MEGABYTES)
.build();

public static SimpleAttributeDefinition MEMORY_BUFFER_OFFHEAP_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.MEMORY_BUFFER_OFFHEAP_ATTRIBUTE.getModelName(), ModelType.BOOLEAN)
.setXmlName(Element.MEMORY_BUFFER_OFFHEAP_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition MEMORY_BUFFER_OFFHEAP_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_MEMORY_BUFFER_OFFHEAP_ATTRIBUTE.getModelName(), ModelType.BOOLEAN)
.setXmlName(Element.BUFFER_MANAGER_MEMORY_BUFFER_OFFHEAP_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(false))
.build();

public static SimpleAttributeDefinition MAX_STORAGE_OBJECT_SIZE_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.MAX_STORAGE_OBJECT_SIZE_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.MAX_STORAGE_OBJECT_SIZE_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition MAX_STORAGE_OBJECT_SIZE_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_MAX_STORAGE_OBJECT_SIZE_ATTRIBUTE.getModelName(), ModelType.INT)
.setXmlName(Element.BUFFER_MANAGER_MAX_STORAGE_OBJECT_SIZE_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(8388608))
.setMeasurementUnit(MeasurementUnit.BYTES)
.build();

public static SimpleAttributeDefinition INLINE_LOBS = new SimpleAttributeDefinitionBuilder(Element.INLINE_LOBS.getModelName(), ModelType.BOOLEAN)
.setXmlName(Element.INLINE_LOBS.getXMLName())
public static SimpleAttributeDefinition INLINE_LOBS = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_INLINE_LOBS.getModelName(), ModelType.BOOLEAN)
.setXmlName(Element.BUFFER_MANAGER_INLINE_LOBS.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(true))
.build();

public static SimpleAttributeDefinition ENCRYPT_FILES_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.ENCRYPT_FILES_ATTRIBUTE.getModelName(), ModelType.BOOLEAN)
.setXmlName(Element.ENCRYPT_FILES_ATTRIBUTE.getXMLName())
public static SimpleAttributeDefinition ENCRYPT_FILES_ATTRIBUTE = new SimpleAttributeDefinitionBuilder(Element.BUFFER_MANAGER_ENCRYPT_FILES_ATTRIBUTE.getModelName(), ModelType.BOOLEAN)
.setXmlName(Element.BUFFER_MANAGER_ENCRYPT_FILES_ATTRIBUTE.getXMLName())
.setAllowNull(true)
.setAllowExpression(false)
.setDefaultValue(new ModelNode(false))
Expand Down
Expand Up @@ -30,7 +30,7 @@
public class TeiidExtension implements Extension {

public static final String TEIID_SUBSYSTEM = "teiid"; //$NON-NLS-1$
public static ModelVersion TEIID_VERSION = ModelVersion.create(1, 1);
public static ModelVersion TEIID_VERSION = ModelVersion.create(1, 2);

public static ResourceDescriptionResolver getResourceDescriptionResolver(final String keyPrefix) {
return new StandardResourceDescriptionResolver(keyPrefix,
Expand All @@ -53,5 +53,6 @@ public void initialize(ExtensionContext context) {
@Override
public void initializeParsers(ExtensionParsingContext context) {
context.setSubsystemXmlMapping(TEIID_SUBSYSTEM, Namespace.CURRENT.getUri(), TeiidSubsystemParser.INSTANCE);
context.setSubsystemXmlMapping(TEIID_SUBSYSTEM, Namespace.TEIID_1_1.getUri(), TeiidSubsystemParser.INSTANCE);
}
}

0 comments on commit 9f74db9

Please sign in to comment.