Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master into pubsub-hp #1591

Merged
merged 26 commits into from
Feb 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bb99a20
Update version to 0.8.1-SNAPSHOT (#1467)
garrettjonesgoogle Dec 9, 2016
b85e1cc
Add link to Maven Central for maven-central badge. (#1468)
tswast Dec 9, 2016
9a308a2
fix more races in pubsub tests
pongad Dec 12, 2016
15c9e23
Merge pull request #1473 from pongad/fix-race
pongad Dec 12, 2016
0611949
Regenerating SPI layer (#1501)
garrettjonesgoogle Jan 5, 2017
cd45170
Updating grpc dependency to 1.0.3 (#1504)
garrettjonesgoogle Jan 6, 2017
3da8747
Release 0.8.1 (#1512)
garrettjonesgoogle Jan 9, 2017
d884fc0
Fix code snippet (wrong method name) in README.md
Jan 10, 2017
a12b4e7
Merge pull request #1517 from polleyg/patch-1
tswast Jan 10, 2017
424d5b5
Updating version in README files. [ci skip]
garrettjonesgoogle Jan 10, 2017
d1e1c85
Update version to 0.8.2-alpha-SNAPSHOT
garrettjonesgoogle Jan 10, 2017
824ad77
Allow path in URIs passed to newFileSystem (#1470)
jean-philippe-martin Jan 12, 2017
d4d494d
Preventing logging re-entrance at FINE level (#1523)
garrettjonesgoogle Jan 13, 2017
f495c23
Add a PathMatcher for CloudStorageFileSystem (#1469)
jean-philippe-martin Jan 13, 2017
0010dd8
Set timestamp from LogRecord (#1533)
gregw Jan 18, 2017
34c186f
Initialize the default MonitoredResource from a GAE environment (#1535)
gregw Jan 19, 2017
7b6e5c6
BigQuery: Add support to FormatOptions for AVRO
vam-google Jan 27, 2017
6d193de
Reverting changed commited by mistake before review.
vam-google Jan 27, 2017
1643cf1
BigQuery: Add support to FormatOptions for AVRO
vam-google Jan 27, 2017
da93da7
Merge pull request #1576 from vam-google/master
vam-google Jan 28, 2017
cc6796a
use RpcFuture and remove old BundlingSettings (#1572)
pongad Jan 30, 2017
e54f2fa
Release 0.8.2
garrettjonesgoogle Feb 1, 2017
a7dcdab
Updating version in README files. [ci skip]
garrettjonesgoogle Feb 1, 2017
30fd42d
Fixing javadoc error in GaeFlexLoggingEnhancer (#1582)
garrettjonesgoogle Feb 1, 2017
37c160c
Merge branch 'master' into pubsub-hp
pongad Feb 3, 2017
00df00b
get tests to compile and pass
pongad Feb 3, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud</artifactId>
<version>0.8.0</version>
<version>0.8.2-alpha</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud:0.8.0'
compile 'com.google.cloud:google-cloud:0.8.2-alpha'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud" % "0.8.0"
libraryDependencies += "com.google.cloud" % "google-cloud" % "0.8.2-alpha"
```

Example Applications
Expand Down
8 changes: 4 additions & 4 deletions google-cloud-bigquery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
<version>0.8.0-beta</version>
<version>0.8.2-beta</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-bigquery:0.8.0-beta'
compile 'com.google.cloud:google-cloud-bigquery:0.8.2-beta'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "0.8.0-beta"
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "0.8.2-beta"
```

Example Application
Expand Down Expand Up @@ -189,7 +189,7 @@ QueryRequest queryRequest =
.build();
// Request query to be executed and wait for results
QueryResponse queryResponse = bigquery.query(queryRequest);
while (!queryResponse.jobComplete()) {
while (!queryResponse.jobCompleted()) {
Thread.sleep(1000L);
queryResponse = bigquery.getQueryResults(queryResponse.getJobId());
}
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pom</artifactId>
<version>0.8.1-SNAPSHOT</version>
<version>0.8.2-alpha</version>
</parent>
<properties>
<site.installationModule>google-cloud-bigquery</site.installationModule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class FormatOptions implements Serializable {
static final String CSV = "CSV";
static final String JSON = "NEWLINE_DELIMITED_JSON";
static final String DATASTORE_BACKUP = "DATASTORE_BACKUP";
static final String AVRO = "AVRO";
private static final long serialVersionUID = -443376052020423691L;

private final String type;
Expand Down Expand Up @@ -94,6 +95,13 @@ public static FormatOptions datastoreBackup() {
return new FormatOptions(DATASTORE_BACKUP);
}

/**
* Default options for AVRO format.
*/
public static FormatOptions avro() {
return new FormatOptions(AVRO);
}

/**
* Default options for the provided format.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,29 @@ public void testConstructor() {
assertEquals(FormatOptions.JSON, options.getType());
options = new FormatOptions(FormatOptions.DATASTORE_BACKUP);
assertEquals(FormatOptions.DATASTORE_BACKUP, options.getType());
options = new FormatOptions(FormatOptions.AVRO);
assertEquals(FormatOptions.AVRO, options.getType());
}

@Test
@SuppressWarnings("deprecation")
public void testConstructorDeprecated() {
FormatOptions options = new FormatOptions(FormatOptions.CSV);
assertEquals(FormatOptions.CSV, options.type());
options = new FormatOptions(FormatOptions.JSON);
assertEquals(FormatOptions.JSON, options.type());
options = new FormatOptions(FormatOptions.DATASTORE_BACKUP);
assertEquals(FormatOptions.DATASTORE_BACKUP, options.type());
options = new FormatOptions(FormatOptions.AVRO);
assertEquals(FormatOptions.AVRO, options.type());
}

@Test
public void testFactoryMethods() {
assertEquals(FormatOptions.CSV, FormatOptions.csv().getType());
assertEquals(FormatOptions.JSON, FormatOptions.json().getType());
assertEquals(FormatOptions.DATASTORE_BACKUP, FormatOptions.datastoreBackup().getType());
assertEquals(FormatOptions.AVRO, FormatOptions.avro().getType());
}

@Test
Expand Down
6 changes: 3 additions & 3 deletions google-cloud-compute/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-compute</artifactId>
<version>0.8.0</version>
<version>0.8.2-alpha</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-compute:0.8.0'
compile 'com.google.cloud:google-cloud-compute:0.8.2-alpha'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-compute" % "0.8.0"
libraryDependencies += "com.google.cloud" % "google-cloud-compute" % "0.8.2-alpha"
```

Example Application
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-compute/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pom</artifactId>
<version>0.8.1-SNAPSHOT</version>
<version>0.8.2-alpha</version>
</parent>
<properties>
<site.installationModule>google-cloud-compute</site.installationModule>
Expand Down
6 changes: 3 additions & 3 deletions google-cloud-contrib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-contrib</artifactId>
<version>0.8.0</version>
<version>0.8.2-alpha</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-contrib:0.8.0'
compile 'com.google.cloud:google-cloud-contrib:0.8.2-alpha'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-contrib" % "0.8.0"
libraryDependencies += "com.google.cloud" % "google-cloud-contrib" % "0.8.2-alpha"
```

### google-cloud-nio-examples
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-contrib/google-cloud-nio-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ To run this example:
4. Run the sample with:

```
java -cp google-cloud-contrib/google-cloud-nio/target/google-cloud-nio-0.7.1-SNAPSHOT-shaded.jar:google-cloud-contrib/google-cloud-nio-examples/target/google-cloud-nio-examples-0.7.1-SNAPSHOT.jar com.google.cloud.nio.examples.ListFilesystems
java -cp google-cloud-contrib/google-cloud-nio/target/google-cloud-nio-0.8.3-alpha-SNAPSHOT-shaded.jar:google-cloud-contrib/google-cloud-nio-examples/target/google-cloud-nio-examples-0.8.3-alpha-SNAPSHOT.jar com.google.cloud.nio.examples.ListFilesystems
```

Notice that it lists Google Cloud Storage, which it wouldn't if you ran it without the NIO jar:
```
java -cp google-cloud-contrib/google-cloud-nio-examples/target/google-cloud-nio-examples-0.7.1-SNAPSHOT.jar com.google.cloud.nio.examples.ListFilesystems
java -cp google-cloud-contrib/google-cloud-nio-examples/target/google-cloud-nio-examples-0.8.3-alpha-SNAPSHOT.jar com.google.cloud.nio.examples.ListFilesystems
```

The sample doesn't have anything about Google Cloud Storage in it. It gets that ability from the NIO
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-contrib/google-cloud-nio-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-contrib</artifactId>
<version>0.8.1-SNAPSHOT</version>
<version>0.8.2-alpha</version>
</parent>
<properties>
<site.installationModule>google-cloud-nio-examples</site.installationModule>
Expand Down
6 changes: 3 additions & 3 deletions google-cloud-contrib/google-cloud-nio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-nio</artifactId>
<version>0.8.0</version>
<version>0.8.2-alpha</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-nio:0.8.0'
compile 'com.google.cloud:google-cloud-nio:0.8.2-alpha'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-nio" % "0.8.0"
libraryDependencies += "com.google.cloud" % "google-cloud-nio" % "0.8.2-alpha"
```

Example Applications
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-contrib/google-cloud-nio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-contrib</artifactId>
<version>0.8.1-SNAPSHOT</version>
<version>0.8.2-alpha</version>
</parent>
<properties>
<site.installationModule>google-cloud-nio</site.installationModule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.net.URISyntaxException;
import java.nio.file.FileStore;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.WatchService;
Expand Down Expand Up @@ -210,13 +211,9 @@ public Set<String> supportedFileAttributeViews() {
return SUPPORTED_VIEWS;
}

/**
* Throws {@link UnsupportedOperationException} because this feature hasn't been implemented yet.
*/
@Override
public PathMatcher getPathMatcher(String syntaxAndPattern) {
// TODO(#813): Implement me.
throw new UnsupportedOperationException();
return FileSystems.getDefault().getPathMatcher(syntaxAndPattern);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,15 @@ public CloudStorageFileSystem getFileSystem(URI uri) {
}

/**
* Returns Cloud Storage file system, provided a URI with no path, e.g. {@code gs://bucket}.
* Returns Cloud Storage file system, provided a URI, e.g. {@code gs://bucket}.
* The URI can include a path component (that will be ignored).
*
* @param uri bucket and current working directory, e.g. {@code gs://bucket}
* @param env map of configuration options, whose keys correspond to the method names of
* {@link CloudStorageConfiguration.Builder}. However you are not allowed to set the working
* directory, as that should be provided in the {@code uri}
* @throws IllegalArgumentException if {@code uri} specifies a user, query, fragment, or scheme is
* not {@value CloudStorageFileSystem#URI_SCHEME}
* @throws IllegalArgumentException if {@code uri} specifies a port, user, query, or fragment, or
* if scheme is not {@value CloudStorageFileSystem#URI_SCHEME}
*/
@Override
public CloudStorageFileSystem newFileSystem(URI uri, Map<String, ?> env) {
Expand All @@ -191,11 +192,10 @@ public CloudStorageFileSystem newFileSystem(URI uri, Map<String, ?> env) {
CloudStorageFileSystem.URI_SCHEME, uri);
checkArgument(
uri.getPort() == -1
&& isNullOrEmpty(uri.getPath())
&& isNullOrEmpty(uri.getQuery())
&& isNullOrEmpty(uri.getFragment())
&& isNullOrEmpty(uri.getUserInfo()),
"GCS FileSystem URIs mustn't have: port, userinfo, path, query, or fragment: %s",
"GCS FileSystem URIs mustn't have: port, userinfo, query, or fragment: %s",
uri);
CloudStorageUtil.checkBucket(uri.getHost());
initStorage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* Unit tests for {@link CloudStorageFileSystemProvider}.
Expand Down Expand Up @@ -644,6 +646,12 @@ public void testProviderEquals() {
assertThat(path1.getFileSystem().provider()).isNotEqualTo(path3.getFileSystem().provider());
}

@Test
public void testNewFileSystem() throws IOException {
Map<String,String> env = new HashMap<>();
FileSystems.newFileSystem(URI.create("gs://bucket/path/to/file"), env);
}

private static CloudStorageConfiguration permitEmptyPathComponents(boolean value) {
return CloudStorageConfiguration.builder().permitEmptyPathComponents(value).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -159,4 +160,27 @@ public void testListFiles() throws IOException {
assertThat(got).containsExactlyElementsIn(goodPaths);
}
}

@Test
public void testMatcher() throws IOException {
try (FileSystem fs = CloudStorageFileSystem.forBucket("bucket")) {
String pattern1 = "glob:*.java";
PathMatcher javaFileMatcher = fs.getPathMatcher(pattern1);
assertMatches(fs, javaFileMatcher, "a.java", true);
assertMatches(fs, javaFileMatcher, "a.text", false);
assertMatches(fs, javaFileMatcher, "folder/c.java", true);
assertMatches(fs, javaFileMatcher, "d", false);

String pattern2 = "glob:*.{java,text}";
PathMatcher javaAndTextFileMatcher = fs.getPathMatcher(pattern2);
assertMatches(fs, javaAndTextFileMatcher, "a.java", true);
assertMatches(fs, javaAndTextFileMatcher, "a.text", true);
assertMatches(fs, javaAndTextFileMatcher, "folder/c.java", true);
assertMatches(fs, javaAndTextFileMatcher, "d", false);
}
}

private void assertMatches(FileSystem fs, PathMatcher matcher, String toMatch, boolean expected) {
assertThat(matcher.matches(fs.getPath(toMatch).getFileName())).isEqualTo(expected);
}
}
2 changes: 1 addition & 1 deletion google-cloud-contrib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pom</artifactId>
<version>0.8.1-SNAPSHOT</version>
<version>0.8.2-alpha</version>
</parent>
<properties>
<site.installationModule>google-cloud-contrib</site.installationModule>
Expand Down
6 changes: 3 additions & 3 deletions google-cloud-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ If you are using Maven, add this to your pom.xml file
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-core</artifactId>
<version>0.8.0</version>
<version>0.8.2-alpha</version>
</dependency>
```
If you are using Gradle, add this to your dependencies
```Groovy
compile 'com.google.cloud:google-cloud-core:0.8.0'
compile 'com.google.cloud:google-cloud-core:0.8.2-alpha'
```
If you are using SBT, add this to your dependencies
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-core" % "0.8.0"
libraryDependencies += "com.google.cloud" % "google-cloud-core" % "0.8.2-alpha"
```

Troubleshooting
Expand Down
8 changes: 4 additions & 4 deletions google-cloud-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pom</artifactId>
<version>0.8.1-SNAPSHOT</version>
<version>0.8.2-alpha</version>
</parent>
<properties>
<site.installationModule>google-cloud-core</site.installationModule>
Expand Down Expand Up @@ -111,7 +111,7 @@
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>0.0.27</version>
<version>0.0.28</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
Expand All @@ -122,7 +122,7 @@
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-common-protos</artifactId>
<version>0.1.3</version>
<version>0.1.5</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
Expand All @@ -133,7 +133,7 @@
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-iam-v1</artifactId>
<version>0.1.3</version>
<version>0.1.5</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
Expand Down
Loading