class SchemaCaches<V extends SchemaElement> {

        private final int size;

        private final IntObjectMap<V> pks;
        private final IntObjectMap<V> vls;
        private final IntObjectMap<V> els;
        private final IntObjectMap<V> ils;

        private final CachedTypes cachedTypes;

        public SchemaCaches(int size) {
            // TODO: improve size of each type for optimized array cache
            this.size = size;

            this.pks = new IntObjectMap<>(size);
            this.vls = new IntObjectMap<>(size);
            this.els = new IntObjectMap<>(size);
            this.ils = new IntObjectMap<>(size);

            this.cachedTypes = new CachedTypes();
        }

        public void updateIfNeeded(V schema) {
            if (schema == null) {
                return;
            }
            Id id = schema.id();
            if (id.number() && id.asLong() > 0L) {
                this.set(schema.type(), id, schema);
            }
        }

        @Watched
        public V get(HugeType type, Id id) {
            assert id.number();
            long longId = id.asLong();
            if (longId <= 0L) {
                assert false : id;
                return null;
            }
            int key = (int) longId;
            if (key >= this.size) {
                return null;
            }
            switch (type) {
                case PROPERTY_KEY:
                    return this.pks.get(key);
                case VERTEX_LABEL:
                    return this.vls.get(key);
                case EDGE_LABEL:
                    return this.els.get(key);
                case INDEX_LABEL:
                    return this.ils.get(key);
                default:
                    return null;
            }
        }

        public void set(HugeType type, Id id, V value) {<FILL_FUNCTION_BODY>}

        public void remove(HugeType type, Id id) {
            assert id.number();
            long longId = id.asLong();
            if (longId <= 0L) {
                return;
            }
            int key = (int) longId;
            if (key >= this.size) {
                return;
            }

            this.setValue(type, key, null);
        }

        public void clear() {
            this.pks.clear();
            this.vls.clear();
            this.els.clear();
            this.ils.clear();

            this.cachedTypes.clear();
        }

        public CachedTypes cachedTypes() {
            return this.cachedTypes;
        }

        private void setValue(HugeType type, int key, V value) {
            switch (type) {
                case PROPERTY_KEY:
                    this.pks.set(key, value);
                    break;
                case VERTEX_LABEL:
                    this.vls.set(key, value);
                    break;
                case EDGE_LABEL:
                    this.els.set(key, value);
                    break;
                case INDEX_LABEL:
                    this.ils.set(key, value);
                    break;
                default:
                    // pass
                    break;
            }
        }
    }

            assert id.number();
            long longId = id.asLong();
            if (longId <= 0L) {
                assert false : id;
                return;
            }
            int key = (int) longId;
            if (key >= this.size) {
                return;
            }

            this.setValue(type, key, value);
        
<methods>public void <init>(org.apache.hugegraph.HugeGraphParams, org.apache.hugegraph.backend.store.BackendStore) ,public void addEdgeLabel(org.apache.hugegraph.schema.EdgeLabel) ,public void addIndexLabel(org.apache.hugegraph.schema.SchemaLabel, org.apache.hugegraph.schema.IndexLabel) ,public org.apache.hugegraph.backend.id.Id addPropertyKey(org.apache.hugegraph.schema.PropertyKey) ,public void addVertexLabel(org.apache.hugegraph.schema.VertexLabel) ,public void checkSchemaName(java.lang.String) ,public org.apache.hugegraph.backend.id.Id clearOlapPk(org.apache.hugegraph.schema.PropertyKey) ,public void createIndexLabelForOlapPk(org.apache.hugegraph.schema.PropertyKey) ,public org.apache.hugegraph.backend.id.Id createOlapPk(org.apache.hugegraph.schema.PropertyKey) ,public boolean existsSchemaId(org.apache.hugegraph.type.HugeType, org.apache.hugegraph.backend.id.Id) ,public org.apache.hugegraph.schema.EdgeLabel getEdgeLabel(org.apache.hugegraph.backend.id.Id) ,public org.apache.hugegraph.schema.EdgeLabel getEdgeLabel(java.lang.String) ,public List<org.apache.hugegraph.schema.EdgeLabel> getEdgeLabels() ,public org.apache.hugegraph.schema.IndexLabel getIndexLabel(org.apache.hugegraph.backend.id.Id) ,public org.apache.hugegraph.schema.IndexLabel getIndexLabel(java.lang.String) ,public List<org.apache.hugegraph.schema.IndexLabel> getIndexLabels() ,public org.apache.hugegraph.backend.id.Id getNextId(org.apache.hugegraph.type.HugeType) ,public org.apache.hugegraph.backend.id.Id getNextSystemId() ,public org.apache.hugegraph.schema.PropertyKey getPropertyKey(org.apache.hugegraph.backend.id.Id) ,public org.apache.hugegraph.schema.PropertyKey getPropertyKey(java.lang.String) ,public List<org.apache.hugegraph.schema.PropertyKey> getPropertyKeys() ,public org.apache.hugegraph.schema.VertexLabel getVertexLabel(org.apache.hugegraph.backend.id.Id) ,public org.apache.hugegraph.schema.VertexLabel getVertexLabel(java.lang.String) ,public List<org.apache.hugegraph.schema.VertexLabel> getVertexLabels() ,public org.apache.hugegraph.backend.id.Id rebuildIndex(org.apache.hugegraph.schema.SchemaElement) ,public org.apache.hugegraph.backend.id.Id rebuildIndex(org.apache.hugegraph.schema.SchemaElement, Set<org.apache.hugegraph.backend.id.Id>) ,public org.apache.hugegraph.backend.id.Id removeEdgeLabel(org.apache.hugegraph.backend.id.Id) ,public org.apache.hugegraph.backend.id.Id removeIndexLabel(org.apache.hugegraph.backend.id.Id) ,public void removeIndexLabelFromBaseLabel(org.apache.hugegraph.schema.IndexLabel) ,public org.apache.hugegraph.backend.id.Id removeOlapPk(org.apache.hugegraph.schema.PropertyKey) ,public org.apache.hugegraph.backend.id.Id removePropertyKey(org.apache.hugegraph.backend.id.Id) ,public org.apache.hugegraph.backend.id.Id removeVertexLabel(org.apache.hugegraph.backend.id.Id) ,public void setNextIdLowest(org.apache.hugegraph.type.HugeType, long) ,public void updateEdgeLabel(org.apache.hugegraph.schema.EdgeLabel) ,public void updateIndexLabel(org.apache.hugegraph.schema.IndexLabel) ,public void updatePropertyKey(org.apache.hugegraph.schema.PropertyKey) ,public void updateSchemaStatus(org.apache.hugegraph.schema.SchemaElement, org.apache.hugegraph.type.define.SchemaStatus) ,public void updateVertexLabel(org.apache.hugegraph.schema.VertexLabel) ,public org.apache.hugegraph.backend.id.Id validOrGenerateId(org.apache.hugegraph.type.HugeType, org.apache.hugegraph.backend.id.Id, java.lang.String) <variables>private final non-sealed org.apache.hugegraph.backend.LocalCounter counter,private final non-sealed org.apache.hugegraph.backend.tx.SchemaIndexTransaction indexTx,private final non-sealed org.apache.hugegraph.backend.store.SystemSchemaStore systemSchemaStore