[jira] [Commented] (COMPRESS-507) Commons Compress cannot be built with JDK14 due to Pack200 removal
[ https://issues.apache.org/jira/browse/COMPRESS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049797#comment-17049797 ] Emmanuel Bourg commented on COMPRESS-507: - I was hoping to build the native library before releasing to Maven Central, but I'm struggling a bit on this part. I'll probably upload a beta release with just the pure Java packer/unpacker and deal with the native library later (the native decompressor is 5 times faster than the Java one). > Commons Compress cannot be built with JDK14 due to Pack200 removal > -- > > Key: COMPRESS-507 > URL: https://issues.apache.org/jira/browse/COMPRESS-507 > Project: Commons Compress > Issue Type: Bug > Components: Build, Compressors >Affects Versions: 1.20 >Reporter: Vincent Privat >Priority: Major > > Oracle dropped Pack200 in JDK14 as per > [https://bugs.openjdk.java.net/browse/JDK-8232022] > Someone expressed his will to maintain Pack200 here: > [https://mail.openjdk.java.net/pipermail/jdk-dev/2020-March/003979.html] > [https://github.com/pfirmstone/Pack200-ex-openjdk] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-vfs] ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider
ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386669382 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: So, support for File or Folder is not great top to bottom This would be part of some effort to make that all work right This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Commented] (COMPRESS-507) Commons Compress cannot be built with JDK14 due to Pack200 removal
[ https://issues.apache.org/jira/browse/COMPRESS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049653#comment-17049653 ] Vincent Privat commented on COMPRESS-507: - Emmanuel's fork seems better concerning the history: only the ~300 commits relevant to Pack200 are there, unlike the 57k commits in Peter's repository. I hope you will join your efforts at [https://github.com/pack200/pack200]. What do you intend to do before releasing a version to maven central? > Commons Compress cannot be built with JDK14 due to Pack200 removal > -- > > Key: COMPRESS-507 > URL: https://issues.apache.org/jira/browse/COMPRESS-507 > Project: Commons Compress > Issue Type: Bug > Components: Build, Compressors >Affects Versions: 1.20 >Reporter: Vincent Privat >Priority: Major > > Oracle dropped Pack200 in JDK14 as per > [https://bugs.openjdk.java.net/browse/JDK-8232022] > Someone expressed his will to maintain Pack200 here: > [https://mail.openjdk.java.net/pipermail/jdk-dev/2020-March/003979.html] > [https://github.com/pfirmstone/Pack200-ex-openjdk] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-codec] aherbert commented on issue #40: CODEC-286 upgrade to commons-lang v3.9
aherbert commented on issue #40: CODEC-286 upgrade to commons-lang v3.9 URL: https://github.com/apache/commons-codec/pull/40#issuecomment-593620996 I am against the bump to 1.8 for convenience. There should be a good reason for this. IIUC you can still include collections 3.9 as a test dependency and require Java 8 to run the build, but the target should be 1.7. We should at least get a last release out on the 1.7 target because it contains some fixes that are applicable to those still running against that version of Java. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ecki commented on a change in pull request #85: VFS-760 Zkprovider
ecki commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386645850 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: > Would you prefer a change to the super function? Yes I think it should be type.hasChildren(). Not sure if that breaks tests, though. I agree to keep the overwrite for now, but it should check getType so it does not return true on virtual nodes. (But that part of the api might be a bit unclear..) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ecki commented on a change in pull request #85: VFS-760 Zkprovider
ecki commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386645850 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: > Would you prefer a change to the super function? Yes I think it should be type.hasChildren(). Not sure if that breaks tests, though. I agree to keep the overwrite for now, but it should check getType so it does not return true on virtual nodes. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider
ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386642337 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: Would you prefer a change to the super function? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider
ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386641924 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: Actually, isFolder won't work. It checks explicitly for FOLDER and doesn't do FOLDER or FILE_OR_FOLDER. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider
ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386641240 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: working on it :) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ecki commented on a change in pull request #85: VFS-760 Zkprovider
ecki commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386640875 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: I think you can remove both, isFolder and exists, both will work based on the getType() This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (IO-649) IOUtils contentEquals method performance improvements
[ https://issues.apache.org/jira/browse/IO-649?focusedWorklogId=396371=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-396371 ] ASF GitHub Bot logged work on IO-649: - Author: ASF GitHub Bot Created on: 02/Mar/20 20:45 Start Date: 02/Mar/20 20:45 Worklog Time Spent: 10m Work Description: brettlounsbury commented on issue #101: IO-649 - Improve the performance of the contentEquals() methods. URL: https://github.com/apache/commons-io/pull/101#issuecomment-593612633 > Sorry about the delay, last day of vacation here ;-) No worries - hope you had a great vacation! This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 396371) Time Spent: 5h 40m (was: 5.5h) > IOUtils contentEquals method performance improvements > - > > Key: IO-649 > URL: https://issues.apache.org/jira/browse/IO-649 > Project: Commons IO > Issue Type: Improvement > Components: Utilities >Affects Versions: 1.0, 1.1 >Reporter: Brett Lounsbury >Priority: Major > Fix For: 2.6 > > Time Spent: 5h 40m > Remaining Estimate: 0h > > > contentEquals() internally wraps any given InputStream/Reader in a Buffered > version (if it is not already buffered) which avoids a lot of IO penalties, > but then it proceeds to read each byte/character one at a time. This leads > to significantly more method calls and also a lot of byte -> int casting > since the read() method returns an int between 0 and 255 instead of returning > a byte. > > I have a change that modifies the contentEquals() methods to internally > buffer content into a byte/char array and to then do batch comparisons of > those arrays using Arrays.equals instead of using a BufferedInputStream or > BufferedReader and making use of the single byte/char read() methods. This > reduces the number of method invocations by a factor equal to the buffer size > and avoids casting every byte read to an int. > > The following table shows the performance increase over 1000 iterations of > comparing 2 1GB InputStream of binary data (stored in memory to avoid I/O). > This test was performed on an EC2 M4.4XL host using Java 1.8.0.232 and there > was a forced System.gc() between each iteration to avoid GC as a source of > latency: > Average: 7236 to 858ms (8.43x speedup) > P50: 7224 to 856ms (8.44x speedup) > P90: 7249 to 860ms (8.43x speedup) > P99: 7410 to 913ms (8.12x speedup) > P100: 8330 to 1278ms (6.52x speedup) > > The following table shows the performance increase over 1000 iterations of > comparing 2 1GB Reader of character data (stored in memory to avoid I/O). > This test was performed on an EC2 M4.4XL host using Java 1.8.0.232 and there > was a forced System.gc() between each iteration to avoid GC as a source of > latency: > Average: 11281 to 1737ms (6.50x speedup) > P50: 11262 to 1735ms (6.49x speedup) > P90: 11292 to 1741ms (6.49x speedup) > P99: 11707 to 1774ms (6.60x speedup) > P100: 12176 to 1884ms (6.46x speedup) > > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-io] brettlounsbury commented on issue #101: IO-649 - Improve the performance of the contentEquals() methods.
brettlounsbury commented on issue #101: IO-649 - Improve the performance of the contentEquals() methods. URL: https://github.com/apache/commons-io/pull/101#issuecomment-593612633 > Sorry about the delay, last day of vacation here ;-) No worries - hope you had a great vacation! This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider
ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386637267 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: Ok @ecki, that makes sense. I'm not sure why HDFS works that way though... I'll try to find the cache stuff This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider
ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386636517 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: I don't think that error code exists in the resources. I have propagated the HDFS author's act of not adding it. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ecki commented on a change in pull request #85: VFS-760 Zkprovider
ecki commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386635910 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: > Because the we need to do the attach and not assume the stat has been retrieved. I don't think that's correct, the staleness of a object is determined by the Cachesstrategy, if you want an attach on each method invocation (or on resolve) you can let VFS do that automatically http://commons.apache.org/proper/commons-vfs/commons-vfs2/apidocs/org/apache/commons/vfs2/CacheStrategy.html This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider
ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386633521 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: I probably took this approach from looking at the HDFS File Object. Which also handles the exception message the same way by the way This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider
ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386632446 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: Because the we need to do the attach and not assume the stat has been retrieved. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Comment Edited] (BSF-45) Error trying to access a MongoDB collection under Apache BSF script
[ https://issues.apache.org/jira/browse/BSF-45?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049622#comment-17049622 ] Bernd Eckenfels edited comment on BSF-45 at 3/2/20 8:22 PM: I think BeanShell does not support generics (<...>) you need to stick to Java 1.4 syntax. {{MongoCollection collection = database.getCollection("customer");}} was (Author: b.eckenfels): I think BSF does not support generics (<...>) you need to stick to Java 1.4 syntax. {{MongoCollection collection = database.getCollection("customer");}} > Error trying to access a MongoDB collection under Apache BSF script > --- > > Key: BSF-45 > URL: https://issues.apache.org/jira/browse/BSF-45 > Project: Commons BSF > Issue Type: Bug > Components: BSF-2.x >Affects Versions: BSF-2.4 > Environment: Java 8 > BSF 2.4.0 >Reporter: Kleyson Rios >Priority: Major > Attachments: exception.txt > > > I'm trying to access a MongoDB collection from a java code to be 'eval' by > BSF. > I tried configure the MongoDB connection in both ways coding the driver > connection and following the tutorial > [https://mongodb.github.io/mongo-java-driver/3.10/driver/tutorials/jndi/] , > but in both cases the same error. > Below the code to be executed by BSF: > > {code:java} > import javax.naming.InitialContext; > import com.mongodb.MongoClient; > import com.mongodb.client.MongoDatabase; > import com.mongodb.client.MongoCollection; > import org.bson.Document; > InitialContext cxt = new InitialContext(); > if ( cxt == null ) { > throw new Exception("Uh oh -- no context!"); > } > MongoClient ds = (MongoClient) cxt.lookup( > "java:/comp/env/mongodb/MongoClient" ); > if ( ds == null ) { > throw new Exception("Data source not found!"); > } > MongoDatabase database = ds.getDatabase("ssp"); > //MongoCollection collection = database.getCollection("customer"); > {code} > > The code above runs fine, but If I uncomment the last line > *MongoCollection collection = database.getCollection("customer")* , > the BSF throw a exception. See the attached *exception.txt* file. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (BSF-45) Error trying to access a MongoDB collection under Apache BSF script
[ https://issues.apache.org/jira/browse/BSF-45?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049622#comment-17049622 ] Bernd Eckenfels edited comment on BSF-45 at 3/2/20 8:21 PM: I think BSF does not support generics (<...>) you need to stick to Java 1.4 syntax. {{MongoCollection collection = database.getCollection("customer");}} was (Author: b.eckenfels): I think BSF does not support generics (`<...>`) you need to stick to Java 1.4 syntax. > Error trying to access a MongoDB collection under Apache BSF script > --- > > Key: BSF-45 > URL: https://issues.apache.org/jira/browse/BSF-45 > Project: Commons BSF > Issue Type: Bug > Components: BSF-2.x >Affects Versions: BSF-2.4 > Environment: Java 8 > BSF 2.4.0 >Reporter: Kleyson Rios >Priority: Major > Attachments: exception.txt > > > I'm trying to access a MongoDB collection from a java code to be 'eval' by > BSF. > I tried configure the MongoDB connection in both ways coding the driver > connection and following the tutorial > [https://mongodb.github.io/mongo-java-driver/3.10/driver/tutorials/jndi/] , > but in both cases the same error. > Below the code to be executed by BSF: > > {code:java} > import javax.naming.InitialContext; > import com.mongodb.MongoClient; > import com.mongodb.client.MongoDatabase; > import com.mongodb.client.MongoCollection; > import org.bson.Document; > InitialContext cxt = new InitialContext(); > if ( cxt == null ) { > throw new Exception("Uh oh -- no context!"); > } > MongoClient ds = (MongoClient) cxt.lookup( > "java:/comp/env/mongodb/MongoClient" ); > if ( ds == null ) { > throw new Exception("Data source not found!"); > } > MongoDatabase database = ds.getDatabase("ssp"); > //MongoCollection collection = database.getCollection("customer"); > {code} > > The code above runs fine, but If I uncomment the last line > *MongoCollection collection = database.getCollection("customer")* , > the BSF throw a exception. See the attached *exception.txt* file. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Comment Edited] (BSF-45) Error trying to access a MongoDB collection under Apache BSF script
[ https://issues.apache.org/jira/browse/BSF-45?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049622#comment-17049622 ] Bernd Eckenfels edited comment on BSF-45 at 3/2/20 8:20 PM: I think BSF does not support generics (`<...>`) you need to stick to Java 1.4 syntax. was (Author: b.eckenfels): I think BSF does not support generics (`<...>` you need to stick to Java 1.4 syntax. > Error trying to access a MongoDB collection under Apache BSF script > --- > > Key: BSF-45 > URL: https://issues.apache.org/jira/browse/BSF-45 > Project: Commons BSF > Issue Type: Bug > Components: BSF-2.x >Affects Versions: BSF-2.4 > Environment: Java 8 > BSF 2.4.0 >Reporter: Kleyson Rios >Priority: Major > Attachments: exception.txt > > > I'm trying to access a MongoDB collection from a java code to be 'eval' by > BSF. > I tried configure the MongoDB connection in both ways coding the driver > connection and following the tutorial > [https://mongodb.github.io/mongo-java-driver/3.10/driver/tutorials/jndi/] , > but in both cases the same error. > Below the code to be executed by BSF: > > {code:java} > import javax.naming.InitialContext; > import com.mongodb.MongoClient; > import com.mongodb.client.MongoDatabase; > import com.mongodb.client.MongoCollection; > import org.bson.Document; > InitialContext cxt = new InitialContext(); > if ( cxt == null ) { > throw new Exception("Uh oh -- no context!"); > } > MongoClient ds = (MongoClient) cxt.lookup( > "java:/comp/env/mongodb/MongoClient" ); > if ( ds == null ) { > throw new Exception("Data source not found!"); > } > MongoDatabase database = ds.getDatabase("ssp"); > //MongoCollection collection = database.getCollection("customer"); > {code} > > The code above runs fine, but If I uncomment the last line > *MongoCollection collection = database.getCollection("customer")* , > the BSF throw a exception. See the attached *exception.txt* file. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (BSF-45) Error trying to access a MongoDB collection under Apache BSF script
[ https://issues.apache.org/jira/browse/BSF-45?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049622#comment-17049622 ] Bernd Eckenfels commented on BSF-45: I think BSF does not support generics (`<...>` you need to stick to Java 1.4 syntax. > Error trying to access a MongoDB collection under Apache BSF script > --- > > Key: BSF-45 > URL: https://issues.apache.org/jira/browse/BSF-45 > Project: Commons BSF > Issue Type: Bug > Components: BSF-2.x >Affects Versions: BSF-2.4 > Environment: Java 8 > BSF 2.4.0 >Reporter: Kleyson Rios >Priority: Major > Attachments: exception.txt > > > I'm trying to access a MongoDB collection from a java code to be 'eval' by > BSF. > I tried configure the MongoDB connection in both ways coding the driver > connection and following the tutorial > [https://mongodb.github.io/mongo-java-driver/3.10/driver/tutorials/jndi/] , > but in both cases the same error. > Below the code to be executed by BSF: > > {code:java} > import javax.naming.InitialContext; > import com.mongodb.MongoClient; > import com.mongodb.client.MongoDatabase; > import com.mongodb.client.MongoCollection; > import org.bson.Document; > InitialContext cxt = new InitialContext(); > if ( cxt == null ) { > throw new Exception("Uh oh -- no context!"); > } > MongoClient ds = (MongoClient) cxt.lookup( > "java:/comp/env/mongodb/MongoClient" ); > if ( ds == null ) { > throw new Exception("Data source not found!"); > } > MongoDatabase database = ds.getDatabase("ssp"); > //MongoCollection collection = database.getCollection("customer"); > {code} > > The code above runs fine, but If I uncomment the last line > *MongoCollection collection = database.getCollection("customer")* , > the BSF throw a exception. See the attached *exception.txt* file. > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-vfs] ecki commented on a change in pull request #85: VFS-760 Zkprovider
ecki commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386622698 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: BTW Do,we know why it needs to overwrite the exist method instead of using the abstract version or a doExists() impl? The attaching should be left to the decorator. If this has to do with the file type virtual not working, a comment should state that clearly. Removing the function would be better than fixing it ,) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] belugabehr commented on a change in pull request #85: VFS-760 Zkprovider
belugabehr commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386617553 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: I just looked at the `Messages` class and it uses the String formatter, not the SLF4J-style anchors. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] ecki commented on a change in pull request #85: VFS-760 Zkprovider
ecki commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386615214 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: We should also use NLS keys (error codes). BTW i think the VFSException does format the name argument: https://github.com/apache/commons-vfs/blob/249d1dc9fb3f2bd5209aaa299c4ed61414f1fd78/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileSystemException.java#L198 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] belugabehr commented on a change in pull request #85: VFS-760 Zkprovider
belugabehr commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386604609 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: Woops. Introduced this mistake. This is an Exception, not a logging message so you will have to use string concatenation instead: ``` throw new FileSystemException("Unable to check existance: " + getName(), ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-vfs] belugabehr commented on a change in pull request #85: VFS-760 Zkprovider
belugabehr commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386604609 ## File path: commons-vfs2-zookeeper/src/main/java/org/apache/commons/vfs2/provider/zookeeper/ZkFileObject.java ## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.commons.vfs2.provider.zookeeper; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Objects; + +import org.apache.commons.vfs2.FileSystemException; +import org.apache.commons.vfs2.FileType; +import org.apache.commons.vfs2.provider.AbstractFileName; +import org.apache.commons.vfs2.provider.AbstractFileObject; +import org.apache.commons.vfs2.provider.UriParser; +import org.apache.curator.framework.CuratorFramework; +import org.apache.zookeeper.data.Stat; + +public class ZkFileObject extends AbstractFileObject { + + private CuratorFramework framework; + private String path; + private Stat stat; + + protected ZkFileObject(final AbstractFileName name, + final ZkFileSystem fileSystem, final CuratorFramework framework, + final String path) { +super(name, fileSystem); +this.framework = Objects.requireNonNull(framework); +this.path = Objects.requireNonNull(path); + } + + @Override + protected long doGetContentSize() throws Exception { +return this.stat.getDataLength(); + } + + @Override + protected InputStream doGetInputStream() throws Exception { +if (this.stat == null) { + throw new FileSystemException("vfs.provider/read-not-file.error", + getName()); +} + +final byte[] data = (this.stat.getDataLength() == 0) ? new byte[0] +: framework.getData().forPath(this.path); +return new ByteArrayInputStream(data); + } + + @Override + protected FileType doGetType() throws Exception { +return (this.stat == null) ? FileType.IMAGINARY : FileType.FILE_OR_FOLDER; + } + + /** + * Checks if this file is a folder by using its file type. ZooKeeper nodes can + * always be considered as folders or files. + * + * @return true if this file is a regular file. + * @throws FileSystemException if an error occurs. + * @see #getType() + * @see FileType#FOLDER + */ + @Override + public boolean isFolder() throws FileSystemException { +return true; + } + + @Override + protected String[] doListChildren() throws Exception { +if (this.stat == null || this.stat.getNumChildren() == 0) { + return new String[0]; +} + +List children = framework.getChildren().forPath(this.path); +return UriParser.encode(children.toArray(new String[0])); + } + + @Override + protected void doAttach() throws Exception { +try { + this.stat = this.framework.checkExists().forPath(this.path); +} catch (final Exception e) { + this.stat = null; +} + } + + /** + * Determines if the file exists. + * + * @see org.apache.commons.vfs2.provider.AbstractFileObject#exists() + * @return boolean true if file exists, false if not + */ + @Override + public boolean exists() throws FileSystemException { +try { + doAttach(); + return this.stat != null; +} catch (final Exception e) { + throw new FileSystemException("Unable to check existance: {}", getName(), Review comment: Woops. Introduced this mistake. This is an Exception, not a logging message so you will have to use string concatenation instead: ``` throw new FileSystemException("Unable to check existance: " +getName(), ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (IO-649) IOUtils contentEquals method performance improvements
[ https://issues.apache.org/jira/browse/IO-649?focusedWorklogId=396337=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-396337 ] ASF GitHub Bot logged work on IO-649: - Author: ASF GitHub Bot Created on: 02/Mar/20 19:32 Start Date: 02/Mar/20 19:32 Worklog Time Spent: 10m Work Description: garydgregory commented on issue #101: IO-649 - Improve the performance of the contentEquals() methods. URL: https://github.com/apache/commons-io/pull/101#issuecomment-593576953 Sorry about the delay, last day of vacation here ;-) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 396337) Time Spent: 5.5h (was: 5h 20m) > IOUtils contentEquals method performance improvements > - > > Key: IO-649 > URL: https://issues.apache.org/jira/browse/IO-649 > Project: Commons IO > Issue Type: Improvement > Components: Utilities >Affects Versions: 1.0, 1.1 >Reporter: Brett Lounsbury >Priority: Major > Fix For: 2.6 > > Time Spent: 5.5h > Remaining Estimate: 0h > > > contentEquals() internally wraps any given InputStream/Reader in a Buffered > version (if it is not already buffered) which avoids a lot of IO penalties, > but then it proceeds to read each byte/character one at a time. This leads > to significantly more method calls and also a lot of byte -> int casting > since the read() method returns an int between 0 and 255 instead of returning > a byte. > > I have a change that modifies the contentEquals() methods to internally > buffer content into a byte/char array and to then do batch comparisons of > those arrays using Arrays.equals instead of using a BufferedInputStream or > BufferedReader and making use of the single byte/char read() methods. This > reduces the number of method invocations by a factor equal to the buffer size > and avoids casting every byte read to an int. > > The following table shows the performance increase over 1000 iterations of > comparing 2 1GB InputStream of binary data (stored in memory to avoid I/O). > This test was performed on an EC2 M4.4XL host using Java 1.8.0.232 and there > was a forced System.gc() between each iteration to avoid GC as a source of > latency: > Average: 7236 to 858ms (8.43x speedup) > P50: 7224 to 856ms (8.44x speedup) > P90: 7249 to 860ms (8.43x speedup) > P99: 7410 to 913ms (8.12x speedup) > P100: 8330 to 1278ms (6.52x speedup) > > The following table shows the performance increase over 1000 iterations of > comparing 2 1GB Reader of character data (stored in memory to avoid I/O). > This test was performed on an EC2 M4.4XL host using Java 1.8.0.232 and there > was a forced System.gc() between each iteration to avoid GC as a source of > latency: > Average: 11281 to 1737ms (6.50x speedup) > P50: 11262 to 1735ms (6.49x speedup) > P90: 11292 to 1741ms (6.49x speedup) > P99: 11707 to 1774ms (6.60x speedup) > P100: 12176 to 1884ms (6.46x speedup) > > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-io] garydgregory commented on issue #101: IO-649 - Improve the performance of the contentEquals() methods.
garydgregory commented on issue #101: IO-649 - Improve the performance of the contentEquals() methods. URL: https://github.com/apache/commons-io/pull/101#issuecomment-593576953 Sorry about the delay, last day of vacation here ;-) This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (LANG-1519) Add Integer Utils to library
[ https://issues.apache.org/jira/browse/LANG-1519?focusedWorklogId=396335=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-396335 ] ASF GitHub Bot logged work on LANG-1519: Author: ASF GitHub Bot Created on: 02/Mar/20 19:26 Start Date: 02/Mar/20 19:26 Worklog Time Spent: 10m Work Description: garydgregory commented on issue #495: LANG-1519 Add zero, positive & negative util methods URL: https://github.com/apache/commons-lang/pull/495#issuecomment-593574286 What about other JRE numbers like atomic numbers and big numbers? How should those be treated? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 396335) Time Spent: 3h 20m (was: 3h 10m) > Add Integer Utils to library > > > Key: LANG-1519 > URL: https://issues.apache.org/jira/browse/LANG-1519 > Project: Commons Lang > Issue Type: New Feature > Components: lang.* >Reporter: Nivruth Nandigam >Priority: Trivial > Time Spent: 3h 20m > Remaining Estimate: 0h > > Create Integer Utils class for useful integer operations and a placeholder > for adding more useful/important utility functions > > Pull Request: [https://github.com/apache/commons-lang/pull/495] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] garydgregory commented on issue #495: LANG-1519 Add zero, positive & negative util methods
garydgregory commented on issue #495: LANG-1519 Add zero, positive & negative util methods URL: https://github.com/apache/commons-lang/pull/495#issuecomment-593574286 What about other JRE numbers like atomic numbers and big numbers? How should those be treated? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Commented] (VFS-760) Add ZooKeeper File System
[ https://issues.apache.org/jira/browse/VFS-760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049580#comment-17049580 ] David Mollitor commented on VFS-760: [~otto] I was reading the wrong POM file. I deleted my previous comment :) For my purposes, I need a write-capability as well, but I can look at adding that after this gets merged into the official commons git repo. > Add ZooKeeper File System > - > > Key: VFS-760 > URL: https://issues.apache.org/jira/browse/VFS-760 > Project: Commons VFS > Issue Type: Wish >Reporter: David Mollitor >Assignee: Otto Fowler >Priority: Minor > Time Spent: 10m > Remaining Estimate: 0h > > Add VFS integration for using ZooKeeper as a file system. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-lang] garydgregory commented on a change in pull request #496: LANG-1523: Avoid unnecessary allocation in StringUtils.wrapIfMissing.
garydgregory commented on a change in pull request #496: LANG-1523: Avoid unnecessary allocation in StringUtils.wrapIfMissing. URL: https://github.com/apache/commons-lang/pull/496#discussion_r386596611 ## File path: src/main/java/org/apache/commons/lang3/StringUtils.java ## @@ -9508,20 +9514,27 @@ public static String wrapIfMissing(final String str, final char wrapWith) { * @param str *the string to be wrapped, may be {@code null} * @param wrapWith - *the char that will wrap {@code str} + *the string that will wrap {@code str} * @return the wrapped string, or {@code null} if {@code str==null} * @since 3.5 */ public static String wrapIfMissing(final String str, final String wrapWith) { if (isEmpty(str) || isEmpty(wrapWith)) { return str; } + +final boolean wrapStart = !str.startsWith(wrapWith); +final boolean wrapEnd = !str.endsWith(wrapWith); +if (!wrapStart && !wrapEnd) { +return str; +} + final StringBuilder builder = new StringBuilder(str.length() + wrapWith.length() + wrapWith.length()); Review comment: Since the behavior has changed, I would expect a clarification in the Javadoc. Plus a matching test. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-codec] coveralls commented on issue #40: CODEC-286 upgrade to commons-lang v3.9
coveralls commented on issue #40: CODEC-286 upgrade to commons-lang v3.9 URL: https://github.com/apache/commons-codec/pull/40#issuecomment-593569195 [![Coverage Status](https://coveralls.io/builds/29080797/badge)](https://coveralls.io/builds/29080797) Coverage remained the same at 93.84% when pulling **3b398edacf3607de5065a9e3b221cc4e1a8ac83d on nhojpatrick:CODEC-286** into **126f90424cc8f62d928686ec20c6c8bd944b527b on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (CODEC-286) Upgrade to commons-lang v3.9
[ https://issues.apache.org/jira/browse/CODEC-286?focusedWorklogId=396285=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-396285 ] ASF GitHub Bot logged work on CODEC-286: Author: ASF GitHub Bot Created on: 02/Mar/20 18:31 Start Date: 02/Mar/20 18:31 Worklog Time Spent: 10m Work Description: nhojpatrick commented on pull request #40: CODEC-286 upgrade to commons-lang v3.9 URL: https://github.com/apache/commons-codec/pull/40 Handles https://issues.apache.org/jira/browse/CODEC-286 I understand it needs to also bump java to v1.8, but that should probably be done soon. I work on java 1.6, 1.7, 1.8 and 11 projects at work, for the 1.6 and 1.7 projects we have no intension of upgrading and if we needed new commons-codec for new features or bug fixes, it would force us to upgrade which is probably a good thing. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 396285) Remaining Estimate: 0h Time Spent: 10m > Upgrade to commons-lang v3.9 > > > Key: CODEC-286 > URL: https://issues.apache.org/jira/browse/CODEC-286 > Project: Commons Codec > Issue Type: Improvement >Reporter: John Patrick >Priority: Major > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > As Per Email 2020/03/01 11:07, "Java Modules Codec, Collections, IO and > Lang", and > https://github.com/apache/commons-collections/blob/master/CONTRIBUTING.md. > Cleaning up dependencies -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-codec] nhojpatrick opened a new pull request #40: CODEC-286 upgrade to commons-lang v3.9
nhojpatrick opened a new pull request #40: CODEC-286 upgrade to commons-lang v3.9 URL: https://github.com/apache/commons-codec/pull/40 Handles https://issues.apache.org/jira/browse/CODEC-286 I understand it needs to also bump java to v1.8, but that should probably be done soon. I work on java 1.6, 1.7, 1.8 and 11 projects at work, for the 1.6 and 1.7 projects we have no intension of upgrading and if we needed new commons-codec for new features or bug fixes, it would force us to upgrade which is probably a good thing. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Created] (CODEC-286) Upgrade to commons-lang v3.9
John Patrick created CODEC-286: -- Summary: Upgrade to commons-lang v3.9 Key: CODEC-286 URL: https://issues.apache.org/jira/browse/CODEC-286 Project: Commons Codec Issue Type: Improvement Reporter: John Patrick As Per Email 2020/03/01 11:07, "Java Modules Codec, Collections, IO and Lang", and https://github.com/apache/commons-collections/blob/master/CONTRIBUTING.md. Cleaning up dependencies -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Closed] (IO-659) Upgrade to commons-lang v3.9
[ https://issues.apache.org/jira/browse/IO-659?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] John Patrick closed IO-659. --- Resolution: Fixed Opened in wrong project as too many tabs open at different projects so jira takes the last project interacted with > Upgrade to commons-lang v3.9 > > > Key: IO-659 > URL: https://issues.apache.org/jira/browse/IO-659 > Project: Commons IO > Issue Type: Improvement >Reporter: John Patrick >Priority: Major > Labels: pull-request-available > > As Per Email 2020/03/01 11:07, "Java Modules Codec, Collections, IO and > Lang", and > https://github.com/apache/commons-collections/blob/master/CONTRIBUTING.md. > Cleaning up dependencies -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Created] (IO-659) Upgrade to commons-lang v3.9
John Patrick created IO-659: --- Summary: Upgrade to commons-lang v3.9 Key: IO-659 URL: https://issues.apache.org/jira/browse/IO-659 Project: Commons IO Issue Type: Improvement Reporter: John Patrick As Per Email 2020/03/01 11:07, "Java Modules Codec, Collections, IO and Lang", and https://github.com/apache/commons-collections/blob/master/CONTRIBUTING.md. Cleaning up dependencies -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-vfs] ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider
ottobackwards commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386551585 ## File path: pom.xml ## @@ -550,6 +553,16 @@ + +org.apache.curator +curator-client +${curator-version} + + +org.apache.curator +curator-recipes +${curator-version} + Review comment: Thanks, moved This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Commented] (VFS-760) Add ZooKeeper File System
[ https://issues.apache.org/jira/browse/VFS-760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049485#comment-17049485 ] Otto Fowler commented on VFS-760: - I'm not sure what you mean. The parent is the vfs2 project > Add ZooKeeper File System > - > > Key: VFS-760 > URL: https://issues.apache.org/jira/browse/VFS-760 > Project: Commons VFS > Issue Type: Wish >Reporter: David Mollitor >Assignee: Otto Fowler >Priority: Minor > Time Spent: 10m > Remaining Estimate: 0h > > Add VFS integration for using ZooKeeper as a file system. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Created] (CONFIGURATION-781) The conversion handler is not inherited by children
Martin den Heijer created CONFIGURATION-781: --- Summary: The conversion handler is not inherited by children Key: CONFIGURATION-781 URL: https://issues.apache.org/jira/browse/CONFIGURATION-781 Project: Commons Configuration Issue Type: Bug Components: Type conversion Affects Versions: 2.6, 2.1 Environment: Package: commons-configuration2-2.6.jar (from maven central), apache-commons-configuration2-2.1-6.fc30.noarch (from Fedora repo). JVM and Java compiler: java-11-openjdk-11.0.6.10-0.fc31.x86_64 (from Fedora repo). OS: Fedora 31 Reporter: Martin den Heijer Attachments: Main.java If a setting is requested from a configuration with a custom converter, the custom converter will be invoked for all conversions as expected, even if the key points to an element in a INI section/XML child element, etcetera. If the INI section or XML child element is requested using the ImmutableHierarchicalConfiguration.immutableConfigurationAt() or a similar method and the property is requested from the child configuration, then the DefaultConversionHandler is used to perform the conversion. The attached source demonstrates this behaviour: the last get() causes a ConversionException instead of returning the requested Duration. I noticed that the conversion handler is not copied in BaseHierarchicalConfiguration.initSubConfiguration(). It should probably be added there, but I do not know if there are more locations were the conversion handler should be copied as well. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (BSF-45) Error trying to access a MongoDB collection under Apache BSF script
[ https://issues.apache.org/jira/browse/BSF-45?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kleyson Rios updated BSF-45: Attachment: exception.txt Description: I'm trying to access a MongoDB collection from a java code to be 'eval' by BSF. I tried configure the MongoDB connection in both ways coding the driver connection and following the tutorial [https://mongodb.github.io/mongo-java-driver/3.10/driver/tutorials/jndi/] , but in both cases the same error. Below the code to be executed by BSF: {code:java} import javax.naming.InitialContext; import com.mongodb.MongoClient; import com.mongodb.client.MongoDatabase; import com.mongodb.client.MongoCollection; import org.bson.Document; InitialContext cxt = new InitialContext(); if ( cxt == null ) { throw new Exception("Uh oh -- no context!"); } MongoClient ds = (MongoClient) cxt.lookup( "java:/comp/env/mongodb/MongoClient" ); if ( ds == null ) { throw new Exception("Data source not found!"); } MongoDatabase database = ds.getDatabase("ssp"); //MongoCollection collection = database.getCollection("customer"); {code} The code above runs fine, but If I uncomment the last line *MongoCollection collection = database.getCollection("customer")* , the BSF throw a exception. See the attached *exception.txt* file. was: I'm trying to access a MongoDB collection from a java code to be 'eval' by BSF. I tried configure the MongoDB connection in both ways coding the driver connection and following the tutorial [https://mongodb.github.io/mongo-java-driver/3.10/driver/tutorials/jndi/] , but in both cases the same error. Below the code to be executed by BSF: {code:java} import javax.naming.InitialContext; import com.mongodb.MongoClient; import com.mongodb.client.MongoDatabase; import com.mongodb.client.MongoCollection; import org.bson.Document; InitialContext cxt = new InitialContext(); if ( cxt == null ) { throw new Exception("Uh oh -- no context!"); } MongoClient ds = (MongoClient) cxt.lookup( "java:/comp/env/mongodb/MongoClient" ); if ( ds == null ) { throw new Exception("Data source not found!"); } MongoDatabase database = ds.getDatabase("ssp"); //MongoCollection collection = database.getCollection("customer"); {code} The code above runs fine, but If I uncomment the last line *MongoCollection collection = database.getCollection("customer")* , the BSF throw the following exception: {noformat} 13:54:10,119 ERROR [BSFManager] Exception: 13:54:10,119 ERROR [BSFManager] Exception: java.security.PrivilegedActionException: org.apache.bsf.BSFException: BeanShell script error: Parse error at line 22, column 38. Encountered: = BSF info: expression at line: 1 column: columnNo at java.security.AccessController.doPrivileged(Native Method) at org.apache.bsf.BSFManager.eval(BSFManager.java:442) at org.pentaho.reporting.engine.classic.extensions.datasources.scriptable.ScriptableDataFactory.queryData(ScriptableDataFactory.java:159) at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStaticInternal(CompoundDataFactory.java:172) at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:154) at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryData(CompoundDataFactory.java:67) at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryInternal(CachingDataFactory.java:411) at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryData(CachingDataFactory.java:299) at pt.webdetails.cda.dataaccess.PREDataAccess.performRawQuery(PREDataAccess.java:122) at pt.webdetails.cda.dataaccess.SimpleDataAccess.queryDataSource(SimpleDataAccess.java:137) at pt.webdetails.cda.dataaccess.AbstractDataAccess.doQuery(AbstractDataAccess.java:256) at pt.webdetails.cda.CdaEngine.doQuery(CdaEngine.java:141) at pt.webdetails.cda.CdaEngine.doExportQuery(CdaEngine.java:158) at pt.webdetails.cda.CdaCoreService.doQuery(CdaCoreService.java:76) at pt.webdetails.cda.CdaUtils.doQueryInternal(CdaUtils.java:156) at pt.webdetails.cda.CdaUtils.doQuery(CdaUtils.java:173) at pt.webdetails.cda.CdaUtils.doQueryGet(CdaUtils.java:131) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185) at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) at
[GitHub] [commons-vfs] belugabehr commented on a change in pull request #85: VFS-760 Zkprovider
belugabehr commented on a change in pull request #85: VFS-760 Zkprovider URL: https://github.com/apache/commons-vfs/pull/85#discussion_r386535511 ## File path: pom.xml ## @@ -550,6 +553,16 @@ + +org.apache.curator +curator-client +${curator-version} + + +org.apache.curator +curator-recipes +${curator-version} + Review comment: I don't think these should be included in the root POM file since these are specific to the ZKProvider project/module This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Created] (BSF-45) Error trying to access a MongoDB collection under Apache BSF script
Kleyson Rios created BSF-45: --- Summary: Error trying to access a MongoDB collection under Apache BSF script Key: BSF-45 URL: https://issues.apache.org/jira/browse/BSF-45 Project: Commons BSF Issue Type: Bug Components: BSF-2.x Affects Versions: BSF-2.4 Environment: Java 8 BSF 2.4.0 Reporter: Kleyson Rios I'm trying to access a MongoDB collection from a java code to be 'eval' by BSF. I tried configure the MongoDB connection in both ways coding the driver connection and following the tutorial [https://mongodb.github.io/mongo-java-driver/3.10/driver/tutorials/jndi/] , but in both cases the same error. Below the code to be executed by BSF: {code:java} import javax.naming.InitialContext; import com.mongodb.MongoClient; import com.mongodb.client.MongoDatabase; import com.mongodb.client.MongoCollection; import org.bson.Document; InitialContext cxt = new InitialContext(); if ( cxt == null ) { throw new Exception("Uh oh -- no context!"); } MongoClient ds = (MongoClient) cxt.lookup( "java:/comp/env/mongodb/MongoClient" ); if ( ds == null ) { throw new Exception("Data source not found!"); } MongoDatabase database = ds.getDatabase("ssp"); //MongoCollection collection = database.getCollection("customer"); {code} The code above runs fine, but If I uncomment the last line *MongoCollection collection = database.getCollection("customer")* , the BSF throw the following exception: {noformat} 13:54:10,119 ERROR [BSFManager] Exception: 13:54:10,119 ERROR [BSFManager] Exception: java.security.PrivilegedActionException: org.apache.bsf.BSFException: BeanShell script error: Parse error at line 22, column 38. Encountered: = BSF info: expression at line: 1 column: columnNo at java.security.AccessController.doPrivileged(Native Method) at org.apache.bsf.BSFManager.eval(BSFManager.java:442) at org.pentaho.reporting.engine.classic.extensions.datasources.scriptable.ScriptableDataFactory.queryData(ScriptableDataFactory.java:159) at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStaticInternal(CompoundDataFactory.java:172) at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryStatic(CompoundDataFactory.java:154) at org.pentaho.reporting.engine.classic.core.CompoundDataFactory.queryData(CompoundDataFactory.java:67) at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryInternal(CachingDataFactory.java:411) at org.pentaho.reporting.engine.classic.core.cache.CachingDataFactory.queryData(CachingDataFactory.java:299) at pt.webdetails.cda.dataaccess.PREDataAccess.performRawQuery(PREDataAccess.java:122) at pt.webdetails.cda.dataaccess.SimpleDataAccess.queryDataSource(SimpleDataAccess.java:137) at pt.webdetails.cda.dataaccess.AbstractDataAccess.doQuery(AbstractDataAccess.java:256) at pt.webdetails.cda.CdaEngine.doQuery(CdaEngine.java:141) at pt.webdetails.cda.CdaEngine.doExportQuery(CdaEngine.java:158) at pt.webdetails.cda.CdaCoreService.doQuery(CdaCoreService.java:76) at pt.webdetails.cda.CdaUtils.doQueryInternal(CdaUtils.java:156) at pt.webdetails.cda.CdaUtils.doQuery(CdaUtils.java:173) at pt.webdetails.cda.CdaUtils.doQueryGet(CdaUtils.java:131) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185) at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
[jira] [Issue Comment Deleted] (VFS-760) Add ZooKeeper File System
[ https://issues.apache.org/jira/browse/VFS-760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Mollitor updated VFS-760: --- Comment: was deleted (was: [~otto] [~b.eckenfels] Any reason the {{jackrabbit}} maven projects are not modules of the parent {{vfs}} project (and thereby also the zk project) ?) > Add ZooKeeper File System > - > > Key: VFS-760 > URL: https://issues.apache.org/jira/browse/VFS-760 > Project: Commons VFS > Issue Type: Wish >Reporter: David Mollitor >Assignee: Otto Fowler >Priority: Minor > Time Spent: 10m > Remaining Estimate: 0h > > Add VFS integration for using ZooKeeper as a file system. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (VFS-760) Add ZooKeeper File System
[ https://issues.apache.org/jira/browse/VFS-760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049455#comment-17049455 ] David Mollitor commented on VFS-760: [~otto] [~b.eckenfels] Any reason the {{jackrabbit}} maven projects are not modules of the parent {{vfs}} project (and thereby also the zk project) ? > Add ZooKeeper File System > - > > Key: VFS-760 > URL: https://issues.apache.org/jira/browse/VFS-760 > Project: Commons VFS > Issue Type: Wish >Reporter: David Mollitor >Assignee: Otto Fowler >Priority: Minor > Time Spent: 10m > Remaining Estimate: 0h > > Add VFS integration for using ZooKeeper as a file system. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (IO-658) Upgrade to JUnit Pioneer v0.5.4
[ https://issues.apache.org/jira/browse/IO-658?focusedWorklogId=396243=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-396243 ] ASF GitHub Bot logged work on IO-658: - Author: ASF GitHub Bot Created on: 02/Mar/20 17:10 Start Date: 02/Mar/20 17:10 Worklog Time Spent: 10m Work Description: coveralls commented on issue #107: IO-658 Upgrade to JUnit Pioneer v0.5.4 URL: https://github.com/apache/commons-io/pull/107#issuecomment-593510506 [![Coverage Status](https://coveralls.io/builds/29077950/badge)](https://coveralls.io/builds/29077950) Coverage decreased (-0.07%) to 89.408% when pulling **7cbe1a5d817d5658ca457568a7e17fc7db84ebd2 on nhojpatrick:IO-658** into **11f0abe7a3fb6954b2985ca4ab0697b2fb489e84 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 396243) Time Spent: 20m (was: 10m) > Upgrade to JUnit Pioneer v0.5.4 > --- > > Key: IO-658 > URL: https://issues.apache.org/jira/browse/IO-658 > Project: Commons IO > Issue Type: Improvement >Reporter: John Patrick >Priority: Major > Labels: pull-request-available > Time Spent: 20m > Remaining Estimate: 0h > > As Per Email 2020/03/01 11:07, "Java Modules Codec, Collections, IO and > Lang", and > https://github.com/apache/commons-collections/blob/master/CONTRIBUTING.md. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-io] coveralls commented on issue #107: IO-658 Upgrade to JUnit Pioneer v0.5.4
coveralls commented on issue #107: IO-658 Upgrade to JUnit Pioneer v0.5.4 URL: https://github.com/apache/commons-io/pull/107#issuecomment-593510506 [![Coverage Status](https://coveralls.io/builds/29077950/badge)](https://coveralls.io/builds/29077950) Coverage decreased (-0.07%) to 89.408% when pulling **7cbe1a5d817d5658ca457568a7e17fc7db84ebd2 on nhojpatrick:IO-658** into **11f0abe7a3fb6954b2985ca4ab0697b2fb489e84 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Commented] (COMPRESS-507) Commons Compress cannot be built with JDK14 due to Pack200 removal
[ https://issues.apache.org/jira/browse/COMPRESS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049402#comment-17049402 ] Emmanuel Bourg commented on COMPRESS-507: - At this point both projects derive from the OpenJDK 14 sources and are basically identical. I've contacted Peter Firmstone to try to merge our efforts. I'm not aware of other pack200 forks. > Commons Compress cannot be built with JDK14 due to Pack200 removal > -- > > Key: COMPRESS-507 > URL: https://issues.apache.org/jira/browse/COMPRESS-507 > Project: Commons Compress > Issue Type: Bug > Components: Build, Compressors >Affects Versions: 1.20 >Reporter: Vincent Privat >Priority: Major > > Oracle dropped Pack200 in JDK14 as per > [https://bugs.openjdk.java.net/browse/JDK-8232022] > Someone expressed his will to maintain Pack200 here: > [https://mail.openjdk.java.net/pipermail/jdk-dev/2020-March/003979.html] > [https://github.com/pfirmstone/Pack200-ex-openjdk] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Work logged] (IO-658) Upgrade to JUnit Pioneer v0.5.4
[ https://issues.apache.org/jira/browse/IO-658?focusedWorklogId=396222=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-396222 ] ASF GitHub Bot logged work on IO-658: - Author: ASF GitHub Bot Created on: 02/Mar/20 16:37 Start Date: 02/Mar/20 16:37 Worklog Time Spent: 10m Work Description: nhojpatrick commented on pull request #107: IO-658 Upgrade to JUnit Pioneer v0.5.4 URL: https://github.com/apache/commons-io/pull/107 Handles https://issues.apache.org/jira/browse/IO-658 Also based upon https://issues.apache.org/jira/browse/IO-656 branch so pr https://github.com/apache/commons-io/pull/104 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 396222) Remaining Estimate: 0h Time Spent: 10m > Upgrade to JUnit Pioneer v0.5.4 > --- > > Key: IO-658 > URL: https://issues.apache.org/jira/browse/IO-658 > Project: Commons IO > Issue Type: Improvement >Reporter: John Patrick >Priority: Major > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > As Per Email 2020/03/01 11:07, "Java Modules Codec, Collections, IO and > Lang", and > https://github.com/apache/commons-collections/blob/master/CONTRIBUTING.md. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-io] nhojpatrick opened a new pull request #107: IO-658 Upgrade to JUnit Pioneer v0.5.4
nhojpatrick opened a new pull request #107: IO-658 Upgrade to JUnit Pioneer v0.5.4 URL: https://github.com/apache/commons-io/pull/107 Handles https://issues.apache.org/jira/browse/IO-658 Also based upon https://issues.apache.org/jira/browse/IO-656 branch so pr https://github.com/apache/commons-io/pull/104 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Created] (IO-658) Upgrade to JUnit Pioneer v0.5.4
John Patrick created IO-658: --- Summary: Upgrade to JUnit Pioneer v0.5.4 Key: IO-658 URL: https://issues.apache.org/jira/browse/IO-658 Project: Commons IO Issue Type: Improvement Reporter: John Patrick As Per Email 2020/03/01 11:07, "Java Modules Codec, Collections, IO and Lang", and https://github.com/apache/commons-collections/blob/master/CONTRIBUTING.md. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (COMPRESS-507) Commons Compress cannot be built with JDK14 due to Pack200 removal
[ https://issues.apache.org/jira/browse/COMPRESS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049344#comment-17049344 ] Michael Osipov commented on COMPRESS-507: - What does it offer what others don't have? > Commons Compress cannot be built with JDK14 due to Pack200 removal > -- > > Key: COMPRESS-507 > URL: https://issues.apache.org/jira/browse/COMPRESS-507 > Project: Commons Compress > Issue Type: Bug > Components: Build, Compressors >Affects Versions: 1.20 >Reporter: Vincent Privat >Priority: Major > > Oracle dropped Pack200 in JDK14 as per > [https://bugs.openjdk.java.net/browse/JDK-8232022] > Someone expressed his will to maintain Pack200 here: > [https://mail.openjdk.java.net/pipermail/jdk-dev/2020-March/003979.html] > [https://github.com/pfirmstone/Pack200-ex-openjdk] -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-codec] nhojpatrick commented on issue #39: CODEC-285 upgrade to JUnit v5.6.0
nhojpatrick commented on issue #39: CODEC-285 upgrade to JUnit v5.6.0 URL: https://github.com/apache/commons-codec/pull/39#issuecomment-593420212 > When including multiple JUnit dependencies I would use the JUnit BOM in the dependency management to ensure they are kept in sync: > > ``` > > org.junit > junit-bom > X.Y.Z > import > pom > > ``` > > I'd like to highlight that codec targets JDK 7. These changes to the build tools would prevent building on JDK 7. I'm fine with forcing JDK 8+ for the toolchain but Java 7 still has support until July 2022 and someone may care about this. if i can upgrade all the tests quick enough, junit-vintage-engine will be going asap, so i would prefer to keep both separately defined so i can start moving tests from vintage to jupiter, then another future to drop junit-vintage-engine. i agree long term it would be better to define to keep in sync but depending how long the discussions are, depends how long you have duplicate definitions. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-csv] shootercheng closed pull request #58: export page data from db
shootercheng closed pull request #58: export page data from db URL: https://github.com/apache/commons-csv/pull/58 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-codec] nhojpatrick commented on issue #39: CODEC-285 upgrade to JUnit v5.6.0
nhojpatrick commented on issue #39: CODEC-285 upgrade to JUnit v5.6.0 URL: https://github.com/apache/commons-codec/pull/39#issuecomment-593419257 > My preference would be for Codec to update to Java 8. await another Jira/PR, I'm finding that for assertThrows i need lambdas and it would make it easier This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-codec] garydgregory commented on issue #39: CODEC-285 upgrade to JUnit v5.6.0
garydgregory commented on issue #39: CODEC-285 upgrade to JUnit v5.6.0 URL: https://github.com/apache/commons-codec/pull/39#issuecomment-593411592 My preference would be for Codec to update to Java 8. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-codec] aherbert commented on issue #39: CODEC-285 upgrade to JUnit v5.6.0
aherbert commented on issue #39: CODEC-285 upgrade to JUnit v5.6.0 URL: https://github.com/apache/commons-codec/pull/39#issuecomment-593400906 When including multiple JUnit dependencies I would use the JUnit BOM in the dependency management to ensure they are kept in sync: ``` org.junit junit-bom X.Y.Z import pom ``` I'd like to highlight that codec targets JDK 7. These changes to the build tools would prevent building on JDK 7. I'm fine with forcing JDK 8+ for the toolchain but Java 7 still has support until July 2022 and someone may care about this. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (IO-655) Upgrade Hamcrest v2.2
[ https://issues.apache.org/jira/browse/IO-655?focusedWorklogId=396052=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-396052 ] ASF GitHub Bot logged work on IO-655: - Author: ASF GitHub Bot Created on: 02/Mar/20 11:18 Start Date: 02/Mar/20 11:18 Worklog Time Spent: 10m Work Description: coveralls commented on issue #106: IO-655 add hamcrest v2.2 URL: https://github.com/apache/commons-io/pull/106#issuecomment-593353242 [![Coverage Status](https://coveralls.io/builds/29070426/badge)](https://coveralls.io/builds/29070426) Coverage remained the same at 89.473% when pulling **86eb79b086b7da3943dfa29c20974ce9426162bf on nhojpatrick:IO-655** into **11f0abe7a3fb6954b2985ca4ab0697b2fb489e84 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 396052) Time Spent: 20m (was: 10m) > Upgrade Hamcrest v2.2 > - > > Key: IO-655 > URL: https://issues.apache.org/jira/browse/IO-655 > Project: Commons IO > Issue Type: Improvement >Reporter: John Patrick >Priority: Major > Labels: pull-request-available > Time Spent: 20m > Remaining Estimate: 0h > > As Per Email 2020/03/01 11:07, "Java Modules Codec, Collections, IO and > Lang", and > https://github.com/apache/commons-collections/blob/master/CONTRIBUTING.md. > Step 2, update to hamcrest v2.2 -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-io] coveralls commented on issue #106: IO-655 add hamcrest v2.2
coveralls commented on issue #106: IO-655 add hamcrest v2.2 URL: https://github.com/apache/commons-io/pull/106#issuecomment-593353242 [![Coverage Status](https://coveralls.io/builds/29070426/badge)](https://coveralls.io/builds/29070426) Coverage remained the same at 89.473% when pulling **86eb79b086b7da3943dfa29c20974ce9426162bf on nhojpatrick:IO-655** into **11f0abe7a3fb6954b2985ca4ab0697b2fb489e84 on apache:master**. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [commons-lang] nstdio commented on issue #496: LANG-1523: Avoid unnecessary allocation in StringUtils.wrapIfMissing.
nstdio commented on issue #496: LANG-1523: Avoid unnecessary allocation in StringUtils.wrapIfMissing. URL: https://github.com/apache/commons-lang/pull/496#issuecomment-593348020 Done. @kinow This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (LANG-1523) Avoid unnecessary allocation in StringUtils.wrapIfMissing
[ https://issues.apache.org/jira/browse/LANG-1523?focusedWorklogId=396049=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-396049 ] ASF GitHub Bot logged work on LANG-1523: Author: ASF GitHub Bot Created on: 02/Mar/20 11:04 Start Date: 02/Mar/20 11:04 Worklog Time Spent: 10m Work Description: nstdio commented on issue #496: LANG-1523: Avoid unnecessary allocation in StringUtils.wrapIfMissing. URL: https://github.com/apache/commons-lang/pull/496#issuecomment-593348020 Done. @kinow This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 396049) Remaining Estimate: 0h Time Spent: 10m > Avoid unnecessary allocation in StringUtils.wrapIfMissing > - > > Key: LANG-1523 > URL: https://issues.apache.org/jira/browse/LANG-1523 > Project: Commons Lang > Issue Type: Improvement > Components: lang.* >Affects Versions: 3.9 >Reporter: Edgar Asatryan >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > The *StringUtils.wrapIfMissing* creates a new instance of *StringBuilder* > regardless of whether the input is wrapped or not. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[GitHub] [commons-io] nhojpatrick opened a new pull request #106: IO-655 add hamcrest v2.2
nhojpatrick opened a new pull request #106: IO-655 add hamcrest v2.2 URL: https://github.com/apache/commons-io/pull/106 Handles https://issues.apache.org/jira/browse/IO-655 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Work logged] (IO-655) Upgrade Hamcrest v2.2
[ https://issues.apache.org/jira/browse/IO-655?focusedWorklogId=396044=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-396044 ] ASF GitHub Bot logged work on IO-655: - Author: ASF GitHub Bot Created on: 02/Mar/20 11:00 Start Date: 02/Mar/20 11:00 Worklog Time Spent: 10m Work Description: nhojpatrick commented on pull request #106: IO-655 add hamcrest v2.2 URL: https://github.com/apache/commons-io/pull/106 Handles https://issues.apache.org/jira/browse/IO-655 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking --- Worklog Id: (was: 396044) Remaining Estimate: 0h Time Spent: 10m > Upgrade Hamcrest v2.2 > - > > Key: IO-655 > URL: https://issues.apache.org/jira/browse/IO-655 > Project: Commons IO > Issue Type: Improvement >Reporter: John Patrick >Priority: Major > Labels: pull-request-available > Time Spent: 10m > Remaining Estimate: 0h > > As Per Email 2020/03/01 11:07, "Java Modules Codec, Collections, IO and > Lang", and > https://github.com/apache/commons-collections/blob/master/CONTRIBUTING.md. > Step 2, update to hamcrest v2.2 -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Created] (LANG-1523) Avoid unnecessary allocation in StringUtils.wrapIfMissing
Edgar Asatryan created LANG-1523: Summary: Avoid unnecessary allocation in StringUtils.wrapIfMissing Key: LANG-1523 URL: https://issues.apache.org/jira/browse/LANG-1523 Project: Commons Lang Issue Type: Improvement Components: lang.* Affects Versions: 3.9 Reporter: Edgar Asatryan The *StringUtils.wrapIfMissing* creates a new instance of *StringBuilder* regardless of whether the input is wrapped or not. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (COMPRESS-507) Commons Compress cannot be built with JDK14 due to Pack200 removal
[ https://issues.apache.org/jira/browse/COMPRESS-507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17049082#comment-17049082 ] Emmanuel Bourg commented on COMPRESS-507: - I've also started a project to maintain pack200 at https://github.com/pack200/pack200 > Commons Compress cannot be built with JDK14 due to Pack200 removal > -- > > Key: COMPRESS-507 > URL: https://issues.apache.org/jira/browse/COMPRESS-507 > Project: Commons Compress > Issue Type: Bug > Components: Build, Compressors >Affects Versions: 1.20 >Reporter: Vincent Privat >Priority: Major > > Oracle dropped Pack200 in JDK14 as per > [https://bugs.openjdk.java.net/browse/JDK-8232022] > Someone expressed his will to maintain Pack200 here: > [https://mail.openjdk.java.net/pipermail/jdk-dev/2020-March/003979.html] > [https://github.com/pfirmstone/Pack200-ex-openjdk] -- This message was sent by Atlassian Jira (v8.3.4#803005)