GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Customize gcloudCommand of LocalDatastoreHelper · Issue #19 · googleapis/java-datastore

This repository was archived by the owner on Feb 24, 2026. It is now read-only.
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Customize gcloudCommand of LocalDatastoreHelper #19

Copy link
Copy link
Closed
#137
Closed
Customize gcloudCommand of LocalDatastoreHelper#19
#137
Copy link
Assignees
BenWhiteheadathakor
Labels
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@vtnlinh95
vtnlinh95
opened on Aug 18, 2019
Issue body actions

I am using Spring Cloud GCP. It has the auto-configuration to start datastore emulator when starting the app engine devserver. However, when I read through the set up of LocalDatastoreHelper, I could see that the gcloudCommand is hard-coded. Are there any ways that I can customize the options of gcloudCommand ?

    List<String> gcloudCommand = new ArrayList<>(Arrays.asList(GCLOUD_CMD_TEXT.split(" ")));
    gcloudCommand.add(GCLOUD_CMD_PORT_FLAG + "localhost:" + getPort());
    gcloudCommand.add(CONSISTENCY_FLAG + consistency);
    gcloudCommand.add("--no-store-on-disk");
    GcloudEmulatorRunner gcloudRunner =
        new GcloudEmulatorRunner(gcloudCommand, VERSION_PREFIX, MIN_VERSION);
    if (gcdPath != null) {
      gcloudCommand.add("--data-dir=" + gcdPath.toString());
    }

I want to remove the option --not-store-on-disk and would like to change the --data-dir to my local folder.
Moreover, could you help me to find the location of the current data-dir. I do not know where it is.
Thanks

Reacted by John Andre Hestad and Ashley Schroder

Activity

  1. BenWhitehead commented on Oct 25, 2019

    @BenWhitehead
    BenWhitehead
    on Oct 25, 2019
    Contributor
    More actions

    Hi @vtnlinh95 thanks for the question.

    Regarding adding the ability for you to specify your own flags, this is something I'll have to spend some more time looking into to figure out how Spring Cloud GCP is using LocalDatastoreHelper, but it sounds like a good idea to me.

    Regarding the location of the current data-dir, it looks like a temporary directory with the prefix gcd is being created and passed as the argument value for --data-dir=. I'm not sure what platform you are developing on, but for me -- on linux -- I would get a directory that looks like this: /tmp/gcd3249584903177434025.

    Hope this helps a little for the interim.

  2. chingor13
    transferred this issue fromgoogleapis/google-cloud-javaon Jan 7, 2020
  3. chingor13
    added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Jan 7, 2020
  4. aschroder commented on Mar 11, 2020

    @aschroder
    aschroder
    on Mar 11, 2020
    More actions

    I'd like to add my support to this request :)

    Couple of ideas to achieve it:

    • make the LocalDatastoreHelper handle configurable start up params
    • make it subclass-able so that subclasses can manipulate the emulatorRunners

    If you're open to either change, I'm happy to PR it.

  5. BenWhitehead commented on Mar 12, 2020

    @BenWhitehead
    BenWhitehead
    on Mar 12, 2020
    Contributor
    More actions

    Hi @aschroder Thanks for volunteering to help out!

    I think adding the ability to provide some more config parameters would probably be a better path in the long run. I don't think we want to go the route of subclassing for config changes since that creates challenges down the road.

    I'm envisioning the following changes here:

    1. Create a new class com.google.cloud.datastore.testing.LocalDatastoreHelper.Builder
    2. Add each of the existing parameters to the new builder
    3. Add new parameters for data-dir etc to the builder
    4. Move the current default values from the constructor into the new builder
    5. Refactor existing create methods to use the new builder
    6. Add a new builder() factory method to LocalDatastoreHelper

    This should keep compatibility of the existing API, and keep the existing behavior, while exposing the builder for those folks that want more fine-grained control.

    What do you think? Does this sound like something you have time to tackle?

    Reacted by Ajit Thakor
  6. BenWhitehead
    self-assigned this
    on Apr 17, 2020
  7. athakor
    self-assigned this
    on May 19, 2020
  8. BenWhitehead
    closed this as completedin #137on Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @BenWhitehead
    BenWhitehead
  • @athakor
    athakor

Labels

type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.