ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Hurley <jhur...@hortonworks.com>
Subject Re: In-memory Persistence Type
Date Tue, 23 May 2017 12:45:37 GMT
I believe that this database type is only ever used for unit tests.

> On May 18, 2017, at 1:57 PM, Anita Jebaraj <anita.tvl@gmail.com> wrote:
> 
> Hello everyone,
> 
>             I came across the below piece of code in AmbariServer.java,
> Can someone point me to some documentation on In-memory Persistence type or
> on what context it would be used. Thanks in advance
> 
>  @Transactional
>  protected void initDB() throws AmbariException {
>    if (configs.getPersistenceType() == PersistenceType.IN_MEMORY ||
> dbInitNeeded) {
>      LOG.info("Database init needed - creating default data");
>      Users users = injector.getInstance(Users.class);
> 
>      users.createUser("admin", "admin");
>      users.createUser("user", "user");
> 
>      MetainfoEntity schemaVersion = new MetainfoEntity();
>      schemaVersion.setMetainfoName(Configuration.SERVER_VERSION_KEY);
> 
> schemaVersion.setMetainfoValue(VersionUtils.getVersionSubstring(ambariMetaInfo.getServerVersion()));
> 
>      metainfoDAO.create(schemaVersion);
>    }
>  }
> 
> 
> Thanks & Regards,
> Anita Jebaraj


Mime
View raw message