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 — java-docs-samples/appengine-java8/spanner at master · classicvalues/java-docs-samples

Expand file tree

/

spanner

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

spanner

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src/main
src/main
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline

Google Cloud Spanner Sample

Open in Cloud Shell

This sample demonstrates how to use Google Cloud Spanner from Google App Engine standard environment.

Setup

  • Install the Google Cloud SDK and run:
   gcloud init

If this is your first time creating an App engine application:

   gcloud app create
  • Create a Spanner instance.

  • Update SPANNER_INSTANCE value in `appengine-web.xml.

Endpoints

  • /spanner : will run sample operations against the spanner instance in order. Individual tasks can be run using the task query parameter. See SpannerTasks for supported set of tasks. Note : by default all the spanner example operations run in order, this operation may take a while to return.

Running locally

  • Authorize the local application:
   gcloud auth application-default login

You may also create and use service account credentials.

  • App Engine Maven plugins do not work correctly for this sample for local testing. Here is the tracking issue. As a workaround to run locally, this sample uses the Maven Jetty plugin.
   mvn -DSPANNER_INSTANCE=my-spanner-instance jetty:run

To see the results of the local application, open http://localhost:8080/spanner in a web browser. Note : by default all the spanner example operations run in order, this operation may take a while to show results.

Deploying

$ mvn clean package appengine:deploy

To see the results of the deployed sample application, open https://spanner-dot-PROJECTID.appspot.com/spanner in a web browser. Note : by default all the spanner example operations run in order, this operation may take a while to show results.

You are visitor 01402503 — 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.