在这里,我们将给大家分享关于描述的知识,让您更了解description标签怎么写?的本质,同时也会涉及到如何更有效地金瑞帆高端建站-description描述标签、@Api(tags="testCo
在这里,我们将给大家分享关于描述的知识,让您更了解description标签怎么写?的本质,同时也会涉及到如何更有效地 金瑞帆高端建站 - description 描述标签、@Api(tags = "testController", description = "测试使用") 不显示description 内容、clickhouse-copier 失败了,有人遇到这个问题吗?Can''t get description node /root/t.xml/description、com.google.protobuf.Descriptors.DescriptorValidationException的实例源码的内容。
本文目录一览:- 描述(description)标签怎么写?(描述标签是什么)
- 金瑞帆高端建站 - description 描述标签
- @Api(tags = "testController", description = "测试使用") 不显示description 内容
- clickhouse-copier 失败了,有人遇到这个问题吗?Can''t get description node /root/t.xml/description
- com.google.protobuf.Descriptors.DescriptorValidationException的实例源码
描述(description)标签怎么写?(描述标签是什么)
a:主页描述尽量把描述写的吸引人,要有亮点,用一句话总结你的网站主要做什么,适当布局几个关键词,80~100个汉字左右有宜。
b:栏目的描述用一来总结当前栏目是做什么的,要注意描述尽量带上当前栏目的关键词。
c:只需要把文章中某段话提取来即可,需要注意的是这段话一定要包含优化的长尾关键词。
金瑞帆高端建站 - description 描述标签

金瑞帆高端建站 - description 描述标签
description 描述标签提供了关于这个网页的总括性描述,网页的标题可能是由一些单词和短语组成的,而网页的描述元标签则常常是由一两个语句或段落组成的。如果网页摘要里的某个词语恰好出现在用户的查询里,那么这个词语将被高亮显 示,如果描述标签写的好,可以提升页面的点击率。
关于 description 的写作,description 标签准确概括该网页的内容,每一个网页应该创建各不相同的描述标签,避免所有的网页或很多网页使用千篇一律的 description 标签。
keywords 关键词标签,对于页面优化来说,重要性已经大不如前,甚至有种说法是,keywords 标签已经没用了,不过,就算搜索引擎已经不将 keywords 考虑进,写一下 keywords 标签可能还会有些作用,不过 keywords 里面不要堆砌太多关键字,否则可能适得其反,写上 4、5 个核心关键字即可。
@Api(tags = "testController", description = "测试使用") 不显示description 内容
在knife4j-spring-boot-starter 2.0.3中集成后,怎么显示出标记类中的@Api(tags = "testController", description = "测试使用") description 内容
clickhouse-copier 失败了,有人遇到这个问题吗?Can''t get description node /root/t.xml/description
clickhouse-copier 失败了
clickhouse-copier --daemon --config /root/zookeeper.xml --task-path /root/t.xml --base-dir /root
Code: 36, e.displayText() = DB::Exception: Can''t get description node /root/t.xml/description, Stack trace (when copying this message, always include the lines below):
Can''t get description node /root/t.xml/description
Can''t get description node /root/t.xml/description
/clickhouse-copier_20210322025609_129# cat log.log
2021.03.22 02:56:09.187831 [ 129 ] {} <Information> SentryWriter: Sending crash reports is disabled
2021.03.22 02:56:09.187900 [ 129 ] {} <Trace> Pipe: Pipe capacity is 1.00 MiB
2021.03.22 02:56:09.232163 [ 129 ] {} <Information> : Starting ClickHouse 20.12.4.5 with revision 54443, build id: CB7174248A8BDC07, PID 129
2021.03.22 02:56:09.232315 [ 129 ] {} <Information> Application: Starting clickhouse-copier (id 20210322025609_129, host_id f192bbeca914#20210322025609_129, path /root/clickhouse-copier_20210322025609_129, revision 54443)
2021.03.22 02:56:09.240841 [ 129 ] {} <Trace> ZooKeeper: Initialized, hosts: 10.76.198.198:2181
2021.03.22 02:56:09.242019 [ 129 ] {} <Debug> MemoryTracker: Peak memory usage (for query): 0.00 B.
2021.03.22 02:56:09.243460 [ 129 ] {} <Error> : virtual int DB::ClusterCopierApp::main(const std::vector<std::string> &): Code: 36, e.displayText() = DB::Exception: Can''t get description node /root/t.xml/description, Stack trace (when copying this message, always include the lines below):
0. DB::ClusterCopier::reloadTaskDescription() @ 0x7df7f86 in /usr/bin/clickhouse
1. DB::ClusterCopier::init() @ 0x7df6ed1 in /usr/bin/clickhouse
2. DB::ClusterCopierApp::mainImpl() @ 0x7df4f4f in /usr/bin/clickhouse
3. DB::ClusterCopierApp::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) @ 0x7df550d in /usr/bin/clickhouse
4. Poco::Util::Application::run() @ 0x10d99ff3 in /usr/bin/clickhouse
5. mainEntryClickHouseClusterCopier(int, char**) @ 0x7df565d in /usr/bin/clickhouse
6. main @ 0x7ceacbd in /usr/bin/clickhouse
7. __libc_start_main @ 0x270b3 in /usr/lib/x86_64-linux-gnu/libc-2.31.so
8. _start @ 0x7c9b02e in /usr/bin/clickhouse
(version 20.12.4.5 (official build))
2021.03.22 02:56:09.243496 [ 129 ] {} <Debug> Application: Uninitializing subsystem: Logging Subsystem
2021.03.22 02:56:09.243566 [ 132 ] {} <Trace> BaseDaemon: Received signal -2
2021.03.22 02:56:09.243606 [ 132 ] {} <Information> BaseDaemon: Stop SignalListener thread
com.google.protobuf.Descriptors.DescriptorValidationException的实例源码
/** Creates a resolver which searches the supplied {@link FileDescriptorSet}. */ public static ServiceResolver fromFileDescriptorSet(FileDescriptorSet descriptorSet) { ImmutableMap<String,FileDescriptorProto> descriptorProtoIndex = computeDescriptorProtoIndex(descriptorSet); Map<String,FileDescriptor> descriptorCache = new HashMap<>(); ImmutableList.Builder<FileDescriptor> result = ImmutableList.builder(); for (FileDescriptorProto descriptorProto : descriptorSet.getFileList()) { try { result.add(descriptorFromProto(descriptorProto,descriptorProtoIndex,descriptorCache)); } catch (DescriptorValidationException e) { logger.warn("Skipped descriptor " + descriptorProto.getName() + " due to error",e); continue; } } return new ServiceResolver(result.build()); }
/** * Recursively constructs file descriptors for all dependencies of the supplied proto and returns * a {@link FileDescriptor} for the supplied proto itself. For maximal efficiency,reuse the * descriptorCache argument across calls. */ private static FileDescriptor descriptorFromProto( FileDescriptorProto descriptorProto,ImmutableMap<String,FileDescriptorProto> descriptorProtoIndex,Map<String,FileDescriptor> descriptorCache) throws DescriptorValidationException { // First,check the cache. String descritorName = descriptorProto.getName(); if (descriptorCache.containsKey(descritorName)) { return descriptorCache.get(descritorName); } // Then,fetch all the required dependencies recursively. ImmutableList.Builder<FileDescriptor> dependencies = ImmutableList.builder(); for (String dependencyName : descriptorProto.getDependencyList()) { if (!descriptorProtoIndex.containsKey(dependencyName)) { throw new IllegalArgumentException("Could not find dependency: " + dependencyName); } FileDescriptorProto dependencyProto = descriptorProtoIndex.get(dependencyName); dependencies.add(descriptorFromProto(dependencyProto,descriptorCache)); } // Finally,construct the actual descriptor. FileDescriptor[] empty = new FileDescriptor[0]; return FileDescriptor.buildFrom(descriptorProto,dependencies.build().toArray(empty)); }
public void testInvalidPublicDependency() throws Exception { FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() .setName("foo.proto").build(); FileDescriptorProto barProto = FileDescriptorProto.newBuilder() .setName("boo.proto") .addDependency("foo.proto") .addPublicDependency(1) // Error,should be 0. .build(); FileDescriptor fooFile = Descriptors.FileDescriptor.buildFrom(fooProto,new FileDescriptor[0]); try { Descriptors.FileDescriptor.buildFrom(barProto,new FileDescriptor[] {fooFile}); fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { assertTrue( e.getMessage().indexOf("Invalid public dependency index.") != -1); } }
private FileDescriptor getDeepCanonicalFileDescriptor(final FileDescriptor file,final boolean forceRebuild) throws DescriptorValidationException { if (!forceRebuild && isDeeplyCanonical(file)) { return file; } final FileDescriptor[] dependencies = new FileDescriptor[file.getDependencies().size()]; int i = 0; for (final FileDescriptor dependency : file.getDependencies()) { dependencies[i++] = getDeepCanonicalFileDescriptor(dependency,forceRebuild); } final FileDescriptorProto proto = isCanonical(file) ? file.toProto() : makeCanonicalProto(file); return buildFileDescriptorWithReserializedProto(proto,dependencies); }
@Parameters(name = "{index}:{0}") public static Collection<Object[]> data() { return ImmutableList.<Object[]>of(new Object[] {"NonUniqueFieldName1.proto",NonUniqueException.class,"field name"},new Object[] {"NonUniqueFieldNumber1.proto","field number"},new Object[] {"FieldsInExtensionRange1.proto",FieldInExtensionRangeException.class,""},new Object[] {"InvalidExtensionRange1.proto",InvalidExtensionRange.class,new Object[] {"InvalidExtensionRange2.proto",new Object[] {"InvalidExtensionRange3.proto",new Object[] {"UnresolvedTypeName1.proto",UnresolvedTypeNameException.class,new Object[] {"UnresolvedTypeName2.proto",new Object[] {"UnresolvedTypeName3.proto",new Object[] {"UnresolvedTypeName4.proto",DescriptorValidationException.class,new Object[] {"UnresolvedTypeName5.proto",new Object[] {"NonUniqueExtensionName1.proto",new Object[] {"NonUniqueExtensionNumber1.proto",NonUniqueExtensionNumber.class,""}); }
private static FileDescriptor buildDescriptor( String name,FileDescriptor> descriptors,FileDescriptorProto> protos) throws DescriptorValidationException { FileDescriptor file = descriptors.get(name); if (file != null) { return file; } FileDescriptorProto proto = protos.get(name); FileDescriptor[] deps = new FileDescriptor[proto.getDependencyCount()]; for (int i = 0; i < proto.getDependencyCount(); i++) { deps[i] = buildDescriptor(proto.getDependency(i),descriptors,protos); } file = FileDescriptor.buildFrom(proto,deps); descriptors.put(name,file); return file; }
/** * Builds the new {@code SoyFileSet}. * * @return The new {@code SoyFileSet}. */ public SoyFileSet build() { try { if (!protoTypeProviderBuilder.isEmpty()) { Set<SoyTypeProvider> typeProviders = ImmutableSet.<SoyTypeProvider>of(protoTypeProviderBuilder.build()); localTypeRegistry = new SoyTypeRegistry(typeProviders); } } catch (DescriptorValidationException | IOException ex) { throw new RuntimeException("Malformed descriptor set",ex); } return new SoyFileSet( coreDependencies.apiCallScope,coreDependencies.soyValueConverter,localTypeRegistry == null ? coreDependencies.typeRegistry : localTypeRegistry,coreDependencies.soyFunctionMap,coreDependencies.printDirectives,filesBuilder.build(),getGeneralOptions(),cache,conformanceConfig,loggingConfig,warningSink); }
public void testInvalidPublicDependency() throws Exception { FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() .setName("foo.proto") .build(); FileDescriptorProto barProto = FileDescriptorProto.newBuilder() .setName("boo.proto") .addDependency("foo.proto") .addPublicDependency(1) // Error,new FileDescriptor[] {fooFile}); fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { assertTrue( e.getMessage().indexOf("Invalid public dependency index.") != -1); } }
public void testInvalidPublicDependency() throws Exception { FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() .setName("foo.proto").build(); FileDescriptorProto barProto = FileDescriptorProto.newBuilder() .setName("boo.proto") .addDependency("foo.proto") .addPublicDependency(1) // Error,new FileDescriptor[] {fooFile}); fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { assertTrue( e.getMessage().indexOf("Invalid public dependency index.") != -1); } }
public void testUnkNownFieldsDenied() throws Exception { FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() .setName("foo.proto") .addMessageType(DescriptorProto.newBuilder() .setName("Foo") .addField(FieldDescriptorProto.newBuilder() .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) .setTypeName("Bar") .setName("bar") .setNumber(1))) .build(); try { Descriptors.FileDescriptor.buildFrom(fooProto,new FileDescriptor[0]); fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { assertTrue(e.getMessage().indexOf("Bar") != -1); assertTrue(e.getMessage().indexOf("is not defined") != -1); } }
/** * Tests that the DescriptorValidationException works as intended. */ public void testDescriptorValidatorException() throws Exception { FileDescriptorProto fileDescriptorProto = FileDescriptorProto.newBuilder() .setName("foo.proto") .addMessageType(DescriptorProto.newBuilder() .setName("Foo") .addField(FieldDescriptorProto.newBuilder() .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) .setType(FieldDescriptorProto.Type.TYPE_INT32) .setName("foo") .setNumber(1) .setDefaultValue("invalid") .build()) .build()) .build(); try { Descriptors.FileDescriptor.buildFrom(fileDescriptorProto,new FileDescriptor[0]); fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { // Expected; check that the error message contains some useful hints assertTrue(e.getMessage().indexOf("foo") != -1); assertTrue(e.getMessage().indexOf("Foo") != -1); assertTrue(e.getMessage().indexOf("invalid") != -1); assertTrue(e.getCause() instanceof NumberFormatException); assertTrue(e.getCause().getMessage().indexOf("invalid") != -1); } }
/** * Tests that the DescriptorValidationException works as intended. */ public void testDescriptorValidatorException() throws Exception { FileDescriptorProto fileDescriptorProto = FileDescriptorProto.newBuilder() .setName("foo.proto") .addMessageType(DescriptorProto.newBuilder() .setName("Foo") .addField(FieldDescriptorProto.newBuilder() .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) .setType(FieldDescriptorProto.Type.TYPE_INT32) .setName("foo") .setNumber(1) .setDefaultValue("invalid") .build()) .build()) .build(); try { Descriptors.FileDescriptor.buildFrom(fileDescriptorProto,new FileDescriptor[0]); fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { // Expected; check that the error message contains some useful hints assertTrue(e.getMessage().indexOf("foo") != -1); assertTrue(e.getMessage().indexOf("Foo") != -1); assertTrue(e.getMessage().indexOf("invalid") != -1); assertTrue(e.getCause() instanceof NumberFormatException); assertTrue(e.getCause().getMessage().indexOf("invalid") != -1); } }
public CausalOrderProtobufSerializer(@NotNull final Serializer<T> objectSerializer) { this.objectSerializer = objectSerializer; try { final FileDescriptorProto timestampedMessageFile = FileDescriptorProto.newBuilder() .addMessageType( DescriptorProto.newBuilder() .setName(MESSAGE_NAME) .addField( FieldDescriptorProto.newBuilder() .setLabel(FieldDescriptorProto.Label.LABEL_REPEATED) .setName(IDS_FIELD_NAME) .setNumber(IDS_FIELD_NUMBER) .setType(FieldDescriptorProto.Type.TYPE_BYTES)) .addField( FieldDescriptorProto.newBuilder() .setLabel(FieldDescriptorProto.Label.LABEL_REPEATED) .setName(TIMESTAMPS_FIELD_NAME) .setNumber(TIMESTAMPS_FIELD_NUMBER) .setoptions(FieldOptions.newBuilder() .setPacked(true)) .setType(FieldDescriptorProto.Type.TYPE_UINT64)) .addField( FieldDescriptorProto.newBuilder() .setName(VALUE_FIELD_NAME) .setNumber(VALUE_FIELD_NUMBER) .setType(FieldDescriptorProto.Type.TYPE_BYTES))) .build(); this.messageDescriptor = FileDescriptor .buildFrom(timestampedMessageFile,new FileDescriptor[0]) .findMessageTypeByName(MESSAGE_NAME); this.ids = messageDescriptor.findFieldByName(IDS_FIELD_NAME); this.timestamps = messageDescriptor.findFieldByName(TIMESTAMPS_FIELD_NAME); this.value = messageDescriptor.findFieldByName(VALUE_FIELD_NAME); this.messageParser = Dynamicmessage.newBuilder(messageDescriptor) .buildPartial() .getParserForType(); } catch (final DescriptorValidationException e) { throw new RuntimeException(e); } }
public SingleSourceFifoOrderProtobufSerializer(@NotNull final Serializer<T> objectSerializer) { this.objectSerializer = objectSerializer; try { final FileDescriptorProto timestampedMessageFile = FileDescriptorProto.newBuilder() .addMessageType( DescriptorProto.newBuilder() .setName(MESSAGE_NAME) .addField( FieldDescriptorProto.newBuilder() .setName(TIMESTAMP_FIELD_NAME) .setNumber(TIMESTAMP_FIELD_NUMBER) .setType(FieldDescriptorProto.Type.TYPE_INT64)) .addField( FieldDescriptorProto.newBuilder() .setName(VALUE_FIELD_NAME) .setNumber(VALUE_FIELD_NUMBER) .setType(FieldDescriptorProto.Type.TYPE_BYTES))) .build(); final Descriptor message = FileDescriptor .buildFrom(timestampedMessageFile,new FileDescriptor[0]) .findMessageTypeByName(MESSAGE_NAME); this.timestampedMessageField = message.findFieldByName(TIMESTAMP_FIELD_NAME); this.valueMessageField = message.findFieldByName(VALUE_FIELD_NAME); this.messageBuilder = Dynamicmessage.newBuilder(message); this.messageParser = messageBuilder.buildPartial().getParserForType(); } catch (final DescriptorValidationException e) { throw new RuntimeException(e); } }
static ProtobufRowDataConverter buildrowDataConverter(Hasstorage object,FileDescriptorProto fileProto) { Group group = (Group)object; FileDescriptor fileDescriptor; try { fileDescriptor = FileDescriptor.buildFrom(fileProto,DEPENDENCIES); } catch (DescriptorValidationException ex) { throw new ProtobufBuildException(ex); } return ProtobufRowDataConverter.forGroup(group,fileDescriptor); }
static ProtobufRowConverter buildrowConverter(Hasstorage object,FileDescriptorProto fileProto) { Group group = (Group) object; FileDescriptor fileDescriptor; try { fileDescriptor = FileDescriptor.buildFrom(fileProto,DEPENDENCIES); } catch (DescriptorValidationException ex) { throw new ProtobufBuildException(ex); } return ProtobufRowConverter.forGroup(group,fileDescriptor); }
/** * Parses a serialized schema descriptor (from input stream; closes the stream) * * @param schemaDescIn the descriptor input stream * @return the schema object * @throws DescriptorValidationException * @throws IOException */ public static DynamicSchema parseFrom(InputStream schemaDescIn) throws DescriptorValidationException,IOException { try { int len; byte[] buf = new byte[4096]; ByteArrayOutputStream baos = new ByteArrayOutputStream(); while ((len = schemaDescIn.read(buf)) > 0) baos.write(buf,len); return parseFrom(baos.toByteArray()); } finally { schemaDescIn.close(); } }
private DynamicSchema(FileDescriptorSet fileDescSet) throws DescriptorValidationException { mFileDescSet = fileDescSet; Map<String,FileDescriptor> fileDescMap = init(fileDescSet); Set<String> msgDupes = new HashSet<String>(); Set<String> enumDupes = new HashSet<String>(); for (FileDescriptor fileDesc : fileDescMap.values()) { for (Descriptor msgType : fileDesc.getMessageTypes()) addMessageType(msgType,null,msgDupes,enumDupes); for (EnumDescriptor enumType : fileDesc.getEnumTypes()) addEnumType(enumType,enumDupes); } for (String msgName : msgDupes) mMsgDescriptorMapShort.remove(msgName); for (String enumName : enumDupes) mEnumDescriptorMapShort.remove(enumName); }
/** * Builds a dynamic schema * * @return the schema object * @throws DescriptorValidationException */ public DynamicSchema build() throws DescriptorValidationException { FileDescriptorSet.Builder fileDescSetBuilder = FileDescriptorSet.newBuilder(); fileDescSetBuilder.addFile(mFileDescProtoBuilder.build()); fileDescSetBuilder.mergeFrom(mFileDescSetBuilder.build()); return new DynamicSchema(fileDescSetBuilder.build()); }
/** * Tests that the DescriptorValidationException works as intended. */ public void testDescriptorValidatorException() throws Exception { FileDescriptorProto fileDescriptorProto = FileDescriptorProto.newBuilder() .setName("foo.proto") .addMessageType(DescriptorProto.newBuilder() .setName("Foo") .addField(FieldDescriptorProto.newBuilder() .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) .setType(FieldDescriptorProto.Type.TYPE_INT32) .setName("foo") .setNumber(1) .setDefaultValue("invalid") .build()) .build()) .build(); try { Descriptors.FileDescriptor.buildFrom(fileDescriptorProto,new FileDescriptor[0]); fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { // Expected; check that the error message contains some useful hints assertTrue(e.getMessage().indexOf("foo") != -1); assertTrue(e.getMessage().indexOf("Foo") != -1); assertTrue(e.getMessage().indexOf("invalid") != -1); assertTrue(e.getCause() instanceof NumberFormatException); assertTrue(e.getCause().getMessage().indexOf("invalid") != -1); } }
public void testHiddenDependency() throws Exception { FileDescriptorProto barProto = FileDescriptorProto.newBuilder() .setName("bar.proto") .addMessageType(DescriptorProto.newBuilder().setName("Bar")) .build(); FileDescriptorProto forwardProto = FileDescriptorProto.newBuilder() .setName("forward.proto") .addDependency("bar.proto") .build(); FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() .setName("foo.proto") .addDependency("forward.proto") .addMessageType(DescriptorProto.newBuilder() .setName("Foo") .addField(FieldDescriptorProto.newBuilder() .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) .setTypeName("Bar") .setName("bar") .setNumber(1))) .build(); FileDescriptor barFile = Descriptors.FileDescriptor.buildFrom( barProto,new FileDescriptor[0]); FileDescriptor forwardFile = Descriptors.FileDescriptor.buildFrom( forwardProto,new FileDescriptor[] {barFile}); try { Descriptors.FileDescriptor.buildFrom( fooProto,new FileDescriptor[] {forwardFile}); fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { assertTrue(e.getMessage().indexOf("Bar") != -1); assertTrue(e.getMessage().indexOf("is not defined") != -1); } }
private FileDescriptor build(final FileDescriptor fileDescriptor) { try { return FileDescriptor.buildFrom(makeCanonicalProto(fileDescriptor),fileDescriptor .getDependencies().toArray(new FileDescriptor[0])); } catch (final DescriptorValidationException e) { throw new DescriptorValidationRuntimeException(e); } }
private FileDescriptor build(final FileDescriptorProto proto,final FileDescriptor[] dependencies) { try { final FileDescriptor fileDescriptor = FileDescriptor.buildFrom(proto,dependencies); return FileDescriptor.buildFrom(makeCanonicalProto(fileDescriptor),dependencies); } catch (final DescriptorValidationException e) { throw new DescriptorValidationRuntimeException(e); } }
private static FileDescriptorEx buildFrom(final FileDescriptorProto proto,final FileDescriptor[] dependencies,final boolean reparseCustomOptions) { try { return getInstance(FileDescriptor.buildFrom(proto,dependencies),reparseCustomOptions); } catch (final DescriptorValidationException e) { throw new DescriptorValidationRuntimeException(e); } }
public FileDescriptor getBasicCanonicalFileDescriptor(final boolean forceRebuild) { if (!forceRebuild && isCanonical()) { return delegate; } try { return FileDescriptor.buildFrom(toCanonicalProto(),delegate.getDependencies().toArray(new FileDescriptor[0])); } catch (final DescriptorValidationException e) { throw new DescriptorValidationRuntimeException(e); } }
private FileDescriptor buildFileDescriptorWithReserializedProto(final FileDescriptorProto proto,dependencies); final ExtensionRegistry registry = buildFullRegistryOf(fileDescriptor); FileDescriptor.internalUpdateFileDescriptor(fileDescriptor,registry); return fileDescriptor; } catch (final DescriptorValidationException e) { throw new DescriptorValidationRuntimeException(e); } }
/** * Builds the type provider and returns it. */ public SoyProtoTypeProvider build() throws FileNotFoundException,IOException,DescriptorValidationException { SoyProtoTypeProvider provider = new SoyProtoTypeProvider(); DescriptorAddingDescriptorTreeWalker walker = new DescriptorAddingDescriptorTreeWalker(); walkAll(walker); walker.commitInto(provider); return provider; }
/** * Like {@link #build},but doesn't propagate exceptions that can only arise when descriptors * need to be fetched from the filesystem. */ public SoyProtoTypeProvider buildNoFiles() { Preconditions.checkState( descriptorSources.isEmpty(),"use build(),not buildNoFiles() to load descriptors from files"); try { return build(); } catch (DescriptorValidationException | IOException ex) { throw new AssertionError("File system should not have been touched",ex); } }
/** * Tests that the DescriptorValidationException works as intended. */ public void testDescriptorValidatorException() throws Exception { FileDescriptorProto fileDescriptorProto = FileDescriptorProto.newBuilder() .setName("foo.proto") .addMessageType(DescriptorProto.newBuilder() .setName("Foo") .addField(FieldDescriptorProto.newBuilder() .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) .setType(FieldDescriptorProto.Type.TYPE_INT32) .setName("foo") .setNumber(1) .setDefaultValue("invalid") .build()) .build()) .build(); try { Descriptors.FileDescriptor.buildFrom(fileDescriptorProto,new FileDescriptor[0]); fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { // Expected; check that the error message contains some useful hints assertTrue(e.getMessage().indexOf("foo") != -1); assertTrue(e.getMessage().indexOf("Foo") != -1); assertTrue(e.getMessage().indexOf("invalid") != -1); assertTrue(e.getCause() instanceof NumberFormatException); assertTrue(e.getCause().getMessage().indexOf("invalid") != -1); } }
public void testHiddenDependency() throws Exception { FileDescriptorProto barProto = FileDescriptorProto.newBuilder() .setName("bar.proto") .addMessageType(DescriptorProto.newBuilder().setName("Bar")) .build(); FileDescriptorProto forwardProto = FileDescriptorProto.newBuilder() .setName("forward.proto") .addDependency("bar.proto") .build(); FileDescriptorProto fooProto = FileDescriptorProto.newBuilder() .setName("foo.proto") .addDependency("forward.proto") .addMessageType(DescriptorProto.newBuilder() .setName("Foo") .addField(FieldDescriptorProto.newBuilder() .setLabel(FieldDescriptorProto.Label.LABEL_OPTIONAL) .setTypeName("Bar") .setName("bar") .setNumber(1))) .build(); FileDescriptor barFile = Descriptors.FileDescriptor.buildFrom( barProto,new FileDescriptor[] {forwardFile}); fail("DescriptorValidationException expected"); } catch (DescriptorValidationException e) { assertTrue(e.getMessage().indexOf("Bar") != -1); assertTrue(e.getMessage().indexOf("is not defined") != -1); } }
static FileDescriptorProto validateAndGenerate(Hasstorage object,ProtobufRowFormat.Type formatType,FileDescriptorProto fileProto,AISValidationOutput output) { if (!(object instanceof Group)) { output.reportFailure(new AISValidationFailure(new StorageDescriptionInvalidException(object,"is not a Group and cannot use Protocol Buffers"))); return null; } Group group = (Group)object; if (formatType == ProtobufRowFormat.Type.SINGLE_TABLE) { if (!group.getRoot().getChildJoins().isEmpty()) { output.reportFailure(new AISValidationFailure(new StorageDescriptionInvalidException(object,"has more than one table"))); return null; } } int currentVersion = sumTabLeversions(group.getRoot()); if (fileProto != null) { int storedVersion = fileProto.getoptions() .getExtension(CustomOptions.GroupOptions.fdbsql).getVersion(); if (storedVersion == currentVersion) { return fileProto; } } FileDescriptorSet set = null; if (fileProto != null) { FileDescriptorSet.Builder builder = FileDescriptorSet.newBuilder(); builder.addFile(fileProto); set = builder.build(); } AISToProtobuf ais2p = new AISToProtobuf(formatType,set); ais2p.addGroup(group); set = ais2p.build(); fileProto = set.getFile(0); // Only added one group. // Make sure it will build before committing to this format. try { FileDescriptor.buildFrom(fileProto,DEPENDENCIES); } catch (DescriptorValidationException ex) { output.reportFailure(new AISValidationFailure(new ProtobufBuildException(ex))); } return fileProto; }
public DescriptorValidationRuntimeException(final DescriptorValidationException delegate) { super(delegate.getMessage(),delegate); problemSymbolName = delegate.getProblemSymbolName(); proto = delegate.getProblemProto(); description = delegate.getDescription(); }
private FileDescriptor createFileDescriptor(FileDescriptorProto fileProto,FileDescriptor[] dependencies) throws DescriptorValidationException { return FileDescriptor.buildFrom(fileProto,dependencies); }
/** * Parses a serialized schema descriptor (from byte array) * * @param schemaDescBuf the descriptor byte array * @return the schema object * @throws DescriptorValidationException * @throws IOException */ public static DynamicSchema parseFrom(byte[] schemaDescBuf) throws DescriptorValidationException,IOException { return new DynamicSchema(FileDescriptorSet.parseFrom(schemaDescBuf)); }
我们今天的关于描述和description标签怎么写?的分享已经告一段落,感谢您的关注,如果您想了解更多关于 金瑞帆高端建站 - description 描述标签、@Api(tags = "testController", description = "测试使用") 不显示description 内容、clickhouse-copier 失败了,有人遇到这个问题吗?Can''t get description node /root/t.xml/description、com.google.protobuf.Descriptors.DescriptorValidationException的实例源码的相关信息,请在本站查询。
本文标签: