Find GRIDFSDBFile.

@param entityMetadata
the entity metadata
@param key
the key
@return the grid fsdb file
519511
private GridFSDBFile findGridFSDBFile(EntityMetadata entityMetadata, Object key)
    {
        String id = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
        DBObject query = new BasicDBObject("metadata." + id, key);
        KunderaGridFS gfs = new KunderaGridFS(mongoDb, entityMetadata.getTableName());
        return gfs.findOne(query);
    }
319985
public String getDatabaseConfigPage(String key) {

        // don't use File.separatorChar here, result must be a valid URL with "/" path delimiters
        String configUri = FOLDER_DATABASE + key + "/" + "step_4_database_setup.jsp";
        return CmsStringUtil.substitute(configUri, File.separator, "/");
    }
132811
public <E> List<E> findData(EntityMetadata m, Object rowKey, byte[] startRow, byte[] endRow,
            List<Map<String, Object>> columnsToOutput, Filter filters)
    {
        String tableName = HBaseUtils.getHTableName(m.getSchema(), m.getTableName());
        FilterList filterList = getFilterList(filters);
        try
        {
            return handler.readData(tableName, m, rowKey, startRow, endRow, columnsToOutput, filterList);
        }
        catch (IOException ioex)
        {
            log.error("Error during find by range, Caused by: .", ioex);
            throw new KunderaException("Error during find by range, Caused by: .", ioex);
        }
    }
1096197
@SuppressWarnings("unchecked")
    public HashMap<String, HashMap<String, String>> getMetaData() {
        HashMap<String, HashMap<String, String>> result = new HashMap<String, HashMap<String, String>>();
        for (MetaRecord mr : meta) {
            result.put((String) mr.get(FieldName.META_FILENAME),
                    (HashMap<String, String>) mr.get(FieldName.META_PROPERTIES));
        }
        return result;
    }
390355
public Object getLobFromGFSEntity(GridFS gfs, EntityMetadata m, Object entity, KunderaMetadata kunderaMetadata)
    {
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                .getMetamodel(m.getPersistenceUnit());
        EntityType entityType = metaModel.entity(m.getEntityClazz());
        Set<Attribute> columns = entityType.getAttributes();
        for (Attribute column : columns)
        {
            boolean isLob = ((Field) column.getJavaMember()).getAnnotation(Lob.class) != null;
            if (isLob)
            {
                return PropertyAccessorHelper.getObject(entity, (Field) column.getJavaMember());
            }
        }
        return null;
    }
749123
private static ObjectMetadata getObjectMetadataForKey(Key k) {
    String[] bk = decodeKey(k);
    assert (bk.length == 2);
    return getClient().getObjectMetadata(bk[0], bk[1]);
  }
487510
private EntityMetadata metadata(final Class<?> source) {
        EntityMetadata metadata = metadataCache.get(source);

        if (metadata == null) {
            EntityMetadata generated = new ReflectionBasedEntityMetadata(source);
            metadataCache.put(source, generated);
            return generated;
        } else {
            return metadata;
        }
    }
1358230
public void getBlobMetadata(String bucketName, String blobName) throws StorageException {
    // [START storage_get_metadata]
    // Instantiate a Google Cloud Storage client
    Storage storage = StorageOptions.getDefaultInstance().getService();

    // The name of a bucket, e.g. "my-bucket"
    // String bucketName = "my-bucket";

    // The name of a blob, e.g. "my-blob"
    // String blobName = "my-blob";

    // Select all fields
    // Fields can be selected individually e.g. Storage.BlobField.CACHE_CONTROL
    Blob blob = storage.get(bucketName, blobName, BlobGetOption.fields(Storage.BlobField.values()));

    // Print blob metadata
    System.out.println("Bucket: " + blob.getBucket());
    System.out.println("CacheControl: " + blob.getCacheControl());
    System.out.println("ComponentCount: " + blob.getComponentCount());
    System.out.println("ContentDisposition: " + blob.getContentDisposition());
    System.out.println("ContentEncoding: " + blob.getContentEncoding());
    System.out.println("ContentLanguage: " + blob.getContentLanguage());
    System.out.println("ContentType: " + blob.getContentType());
    System.out.println("Crc32c: " + blob.getCrc32c());
    System.out.println("Crc32cHexString: " + blob.getCrc32cToHexString());
    System.out.println("ETag: " + blob.getEtag());
    System.out.println("Generation: " + blob.getGeneration());
    System.out.println("Id: " + blob.getBlobId());
    System.out.println("KmsKeyName: " + blob.getKmsKeyName());
    System.out.println("Md5Hash: " + blob.getMd5());
    System.out.println("Md5HexString: " + blob.getMd5ToHexString());
    System.out.println("MediaLink: " + blob.getMediaLink());
    System.out.println("Metageneration: " + blob.getMetageneration());
    System.out.println("Name: " + blob.getName());
    System.out.println("Size: " + blob.getSize());
    System.out.println("StorageClass: " + blob.getStorageClass());
    System.out.println("TimeCreated: " + new Date(blob.getCreateTime()));
    System.out.println("Last Metadata Update: " + new Date(blob.getUpdateTime()));
    Boolean temporaryHoldIsEnabled = (blob.getTemporaryHold() != null && blob.getTemporaryHold());
    System.out.println("temporaryHold: " + (temporaryHoldIsEnabled ? "enabled" : "disabled"));
    Boolean eventBasedHoldIsEnabled =
        (blob.getEventBasedHold() != null && blob.getEventBasedHold());
    System.out.println("eventBasedHold: " + (eventBasedHoldIsEnabled ? "enabled" : "disabled"));
    if (blob.getRetentionExpirationTime() != null) {
      System.out.println("retentionExpirationTime: " + new Date(blob.getRetentionExpirationTime()));
    }
    if (blob.getMetadata() != null) {
      System.out.println("\n\n\nUser metadata:");
      for (Map.Entry<String, String> userMetadata : blob.getMetadata().entrySet()) {
        System.out.println(userMetadata.getKey() + "=" + userMetadata.getValue());
      }
    }
    // [END storage_get_metadata]
  }
900342
@Override
    public Object find(Class entityClass, Object key)
    {
        Object result = null;
        Object connection = getConnection();
        try
        {
            result = fetch(entityClass, key, connection, null);
        }
        catch (InstantiationException e)
        {
            logger.error("Error during find by key:", e);
            throw new PersistenceException(e);
        }
        catch (IllegalAccessException e)
        {
            logger.error("Error during find by key:", e);
            throw new PersistenceException(e);
        }
        finally
        {
            onCleanup(connection);
        }

        return result;
    }
1350889
public boolean containsCollectionDef(
      java.lang.String key) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    return internalGetCollectionDef().getMap().containsKey(key);
  }
592908
public String getDbProperty(String key) {

        // extract the database key out of the entire key
        String databaseKey = key.substring(0, key.indexOf('.'));
        Properties databaseProperties = getDatabaseProperties().get(databaseKey);

        return databaseProperties.getProperty(key, "");
    }
897282
private Path getDatasetDirForKey(ConfigKeyPath configKey) throws VersionDoesNotExistException {
    return this.fs.getPath(this.storePrefix, configKey.getAbsolutePathString());
  }
954380
protected CFMetaData getCFMetaData(String ks, String cf, Cassandra.Client client)
            throws NotFoundException,
            InvalidRequestException,
            TException,
            org.apache.cassandra.exceptions.InvalidRequestException,
            ConfigurationException
    {
        KsDef ksDef = client.describe_keyspace(ks);
        for (CfDef cfDef : ksDef.cf_defs)
        {
            if (cfDef.name.equalsIgnoreCase(cf))
                return CFMetaData.fromThrift(cfDef);
        }
        return null;
    }
141929
private void populateGFSEntity(EntityMetadata entityMetadata, List entities, GridFSDBFile gfsDBFile)
    {
        Object entity = instantiateEntity(entityMetadata.getEntityClazz(), null);
        handler.getEntityFromGFSDBFile(entityMetadata.getEntityClazz(), entity, entityMetadata, gfsDBFile,
                kunderaMetadata);
        entities.add(entity);
    }
1189164
public static Map<String, String> getMetadataFromSequenceFile(FileSystem fs, Path path) {
        try {
            Configuration conf = new Configuration();
            conf.setInt("io.file.buffer.size", 4096);
            SequenceFile.Reader reader = new SequenceFile.Reader(fs, path, new Configuration());
            SequenceFile.Metadata meta = reader.getMetadata();
            reader.close();
            TreeMap<Text, Text> map = meta.getMetadata();
            Map<String, String> values = new HashMap<String, String>();
            for(Map.Entry<Text, Text> entry: map.entrySet())
                values.put(entry.getKey().toString(), entry.getValue().toString());

            return values;
        } catch(IOException e) {
            throw new RuntimeException(e);
        }
    }
165414
public GridFSInputFile getGFSInputFileFromEntity(GridFS gfs, EntityMetadata m, Object entity,
            KunderaMetadata kunderaMetadata, boolean isUpdate)
    {
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                .getMetamodel(m.getPersistenceUnit());
        EntityType entityType = metaModel.entity(m.getEntityClazz());
        GridFSInputFile gridFSInputFile = null;

        DBObject gfsMetadata = new BasicDBObject();

        Set<Attribute> columns = entityType.getAttributes();
        for (Attribute column : columns)
        {
            boolean isLob = ((Field) column.getJavaMember()).getAnnotation(Lob.class) != null;
            if (isLob)
            {
                gridFSInputFile = createGFSInputFile(gfs, entity, (Field) column.getJavaMember());
                gridFSInputFile.setFilename(column.getName());
            }
            else
            {
                if (isUpdate && column.getName().equals(m.getIdAttribute().getName()))
                {
                    gfsMetadata.put(((AbstractAttribute) column).getJPAColumnName(), new ObjectId());
                }
                else
                    DocumentObjectMapper.extractFieldValue(entity, gfsMetadata, column);
            }
        }
        gridFSInputFile.setMetaData(gfsMetadata);
        return gridFSInputFile;
    }
283875
public static Map<String, String> toMap(List<EntityMetadata> metadata) {
		
		Map<String, String> map = new LinkedHashMap<String, String>();
		
		if(CollectionUtils.isNotEmpty(metadata)) {
			
			for(EntityMetadata m : metadata) {
				
				map.put(m.getName(), m.getValue());
				
			}
		
		}
		
		return map;
		
	}