'java'에 해당되는 글 33건

  1. 2019.10.10 [Reference] How to do in java
  2. 2018.08.06 [Java] print flags
  3. 2018.07.17 [Java] BufferedReader 사용 시 size 설정
  4. 2018.04.03 [Elasticsearch] JSON 스트링으로 질의요청
  5. 2017.12.22 [GC] 관련 링크 모음
  6. 2017.12.12 [Java] Executors 로 간단 multithread 테스트
  7. 2017.11.24 [Java] Excutors 에서 제공하는 ExecutorService
  8. 2017.11.24 [Java] java.util.concurrent 관련 예제
  9. 2017.04.18 [Java] Array Value 존재 유무 확인하기
  10. 2017.01.09 [Gradle] Gradle project 맛보기.

[Reference] How to do in java

ITWeb/스크랩 2019. 10. 10. 13:04

우연히 Spring Batch 관련 자료를 찾다가 얻어 걸린 사이트 입니다.

그냥 한번 따라만 해봤는데, 정리도 잘 되어 있고 코드도 잘 동작 해서 링크 걸어 봤습니다.

 

https://howtodoinjava.com/

 

Java Tutorials - Java Learning Resources - HowToDoInJava

Simple and easy to follow free Java tutorials on spring framework, spring boot, angular, maven, hibernate, jpa, concurrency, collections and much more.

howtodoinjava.com

그럼에도 불구 하고 모든 예제들은 기본적으로 Spring 에 대한 또는 Java 에 대한 이해를 하고 있어야 문제 없이 따라 할 수 있습니다.

 

만약 실행이 안된다면 그건 당신의 실력이 부족해서 입니다.

:

[Java] print flags

ITWeb/개발일반 2018. 8. 6. 12:43

$ java -XX:+PrintFlagsFinal -version


[Global flags]

    uintx AdaptiveSizeDecrementScaleFactor          = 4                                   {product}

    uintx AdaptiveSizeMajorGCDecayTimeScale         = 10                                  {product}

    uintx AdaptiveSizePausePolicy                   = 0                                   {product}

    uintx AdaptiveSizePolicyCollectionCostMargin    = 50                                  {product}

    uintx AdaptiveSizePolicyInitializingSteps       = 20                                  {product}

    uintx AdaptiveSizePolicyOutputInterval          = 0                                   {product}

    uintx AdaptiveSizePolicyWeight                  = 10                                  {product}

    uintx AdaptiveSizeThroughPutPolicy              = 0                                   {product}

    uintx AdaptiveTimeWeight                        = 25                                  {product}

     bool AdjustConcurrency                         = false                               {product}

     bool AggressiveOpts                            = false                               {product}

     intx AliasLevel                                = 3                                   {C2 product}

     bool AlignVector                               = false                               {C2 product}

     intx AllocateInstancePrefetchLines             = 1                                   {product}

     intx AllocatePrefetchDistance                  = 192                                 {product}

     intx AllocatePrefetchInstr                     = 3                                   {product}

     intx AllocatePrefetchLines                     = 4                                   {product}

     intx AllocatePrefetchStepSize                  = 64                                  {product}

     intx AllocatePrefetchStyle                     = 1                                   {product}

     bool AllowJNIEnvProxy                          = false                               {product}

     bool AllowNonVirtualCalls                      = false                               {product}

     bool AllowParallelDefineClass                  = false                               {product}

     bool AllowUserSignalHandlers                   = false                               {product}

     bool AlwaysActAsServerClassMachine             = false                               {product}

     bool AlwaysCompileLoopMethods                  = false                               {product}

     bool AlwaysLockClassLoader                     = false                               {product}

     bool AlwaysPreTouch                            = false                               {product}

     bool AlwaysRestoreFPU                          = false                               {product}

     bool AlwaysTenure                              = false                               {product}

     bool AssertOnSuspendWaitFailure                = false                               {product}

     bool AssumeMP                                  = false                               {product}

     intx AutoBoxCacheMax                           = 128                                 {C2 product}

    uintx AutoGCSelectPauseMillis                   = 5000                                {product}

     intx BCEATraceLevel                            = 0                                   {product}

     intx BackEdgeThreshold                         = 100000                              {pd product}

     bool BackgroundCompilation                     = true                                {pd product}

    uintx BaseFootPrintEstimate                     = 268435456                           {product}

     intx BiasedLockingBulkRebiasThreshold          = 20                                  {product}

     intx BiasedLockingBulkRevokeThreshold          = 40                                  {product}

     intx BiasedLockingDecayTime                    = 25000                               {product}

     intx BiasedLockingStartupDelay                 = 4000                                {product}

     bool BindGCTaskThreadsToCPUs                   = false                               {product}

     bool BlockLayoutByFrequency                    = true                                {C2 product}

     intx BlockLayoutMinDiamondPercentage           = 20                                  {C2 product}

     bool BlockLayoutRotateLoops                    = true                                {C2 product}

     bool BranchOnRegister                          = false                               {C2 product}

     bool BytecodeVerificationLocal                 = false                               {product}

     bool BytecodeVerificationRemote                = true                                {product}

     bool C1OptimizeVirtualCallProfiling            = true                                {C1 product}

     bool C1ProfileBranches                         = true                                {C1 product}

     bool C1ProfileCalls                            = true                                {C1 product}

     bool C1ProfileCheckcasts                       = true                                {C1 product}

     bool C1ProfileInlinedCalls                     = true                                {C1 product}

     bool C1ProfileVirtualCalls                     = true                                {C1 product}

     bool C1UpdateMethodData                        = true                                {C1 product}

     intx CICompilerCount                          := 4                                   {product}

     bool CICompilerCountPerCPU                     = true                                {product}

     bool CITime                                    = false                               {product}

     bool CMSAbortSemantics                         = false                               {product}

    uintx CMSAbortablePrecleanMinWorkPerIteration   = 100                                 {product}

     intx CMSAbortablePrecleanWaitMillis            = 100                                 {manageable}

    uintx CMSBitMapYieldQuantum                     = 10485760                            {product}

    uintx CMSBootstrapOccupancy                     = 50                                  {product}

     bool CMSClassUnloadingEnabled                  = true                                {product}

    uintx CMSClassUnloadingMaxInterval              = 0                                   {product}

     bool CMSCleanOnEnter                           = true                                {product}

     bool CMSCompactWhenClearAllSoftRefs            = true                                {product}

    uintx CMSConcMarkMultiple                       = 32                                  {product}

     bool CMSConcurrentMTEnabled                    = true                                {product}

    uintx CMSCoordinatorYieldSleepCount             = 10                                  {product}

     bool CMSDumpAtPromotionFailure                 = false                               {product}

     bool CMSEdenChunksRecordAlways                 = true                                {product}

    uintx CMSExpAvgFactor                           = 50                                  {product}

     bool CMSExtrapolateSweep                       = false                               {product}

    uintx CMSFullGCsBeforeCompaction                = 0                                   {product}

    uintx CMSIncrementalDutyCycle                   = 10                                  {product}

    uintx CMSIncrementalDutyCycleMin                = 0                                   {product}

     bool CMSIncrementalMode                        = false                               {product}

    uintx CMSIncrementalOffset                      = 0                                   {product}

     bool CMSIncrementalPacing                      = true                                {product}

    uintx CMSIncrementalSafetyFactor                = 10                                  {product}

    uintx CMSIndexedFreeListReplenish               = 4                                   {product}

     intx CMSInitiatingOccupancyFraction            = -1                                  {product}

    uintx CMSIsTooFullPercentage                    = 98                                  {product}

   double CMSLargeCoalSurplusPercent                = 0.950000                            {product}

   double CMSLargeSplitSurplusPercent               = 1.000000                            {product}

     bool CMSLoopWarn                               = false                               {product}

    uintx CMSMaxAbortablePrecleanLoops              = 0                                   {product}

     intx CMSMaxAbortablePrecleanTime               = 5000                                {product}

    uintx CMSOldPLABMax                             = 1024                                {product}

    uintx CMSOldPLABMin                             = 16                                  {product}

    uintx CMSOldPLABNumRefills                      = 4                                   {product}

    uintx CMSOldPLABReactivityFactor                = 2                                   {product}

     bool CMSOldPLABResizeQuicker                   = false                               {product}

    uintx CMSOldPLABToleranceFactor                 = 4                                   {product}

     bool CMSPLABRecordAlways                       = true                                {product}

    uintx CMSParPromoteBlocksToClaim                = 16                                  {product}

     bool CMSParallelInitialMarkEnabled             = true                                {product}

     bool CMSParallelRemarkEnabled                  = true                                {product}

     bool CMSParallelSurvivorRemarkEnabled          = true                                {product}

    uintx CMSPrecleanDenominator                    = 3                                   {product}

    uintx CMSPrecleanIter                           = 3                                   {product}

    uintx CMSPrecleanNumerator                      = 2                                   {product}

     bool CMSPrecleanRefLists1                      = true                                {product}

     bool CMSPrecleanRefLists2                      = false                               {product}

     bool CMSPrecleanSurvivors1                     = false                               {product}

     bool CMSPrecleanSurvivors2                     = true                                {product}

    uintx CMSPrecleanThreshold                      = 1000                                {product}

     bool CMSPrecleaningEnabled                     = true                                {product}

     bool CMSPrintChunksInDump                      = false                               {product}

     bool CMSPrintEdenSurvivorChunks                = false                               {product}

     bool CMSPrintObjectsInDump                     = false                               {product}

    uintx CMSRemarkVerifyVariant                    = 1                                   {product}

     bool CMSReplenishIntermediate                  = true                                {product}

    uintx CMSRescanMultiple                         = 32                                  {product}

    uintx CMSSamplingGrain                          = 16384                               {product}

     bool CMSScavengeBeforeRemark                   = false                               {product}

    uintx CMSScheduleRemarkEdenPenetration          = 50                                  {product}

    uintx CMSScheduleRemarkEdenSizeThreshold        = 2097152                             {product}

    uintx CMSScheduleRemarkSamplingRatio            = 5                                   {product}

   double CMSSmallCoalSurplusPercent                = 1.050000                            {product}

   double CMSSmallSplitSurplusPercent               = 1.100000                            {product}

     bool CMSSplitIndexedFreeListBlocks             = true                                {product}

     intx CMSTriggerInterval                        = -1                                  {manageable}

    uintx CMSTriggerRatio                           = 80                                  {product}

     intx CMSWaitDuration                           = 2000                                {manageable}

    uintx CMSWorkQueueDrainThreshold                = 10                                  {product}

     bool CMSYield                                  = true                                {product}

    uintx CMSYieldSleepCount                        = 0                                   {product}

    uintx CMSYoungGenPerWorker                      = 67108864                            {pd product}

    uintx CMS_FLSPadding                            = 1                                   {product}

    uintx CMS_FLSWeight                             = 75                                  {product}

    uintx CMS_SweepPadding                          = 1                                   {product}

    uintx CMS_SweepTimerThresholdMillis             = 10                                  {product}

    uintx CMS_SweepWeight                           = 75                                  {product}

     bool CheckEndorsedAndExtDirs                   = false                               {product}

     bool CheckJNICalls                             = false                               {product}

     bool ClassUnloading                            = true                                {product}

     bool ClassUnloadingWithConcurrentMark          = true                                {product}

     intx ClearFPUAtPark                            = 0                                   {product}

     bool ClipInlining                              = true                                {product}

    uintx CodeCacheExpansionSize                    = 65536                               {pd product}

    uintx CodeCacheMinimumFreeSpace                 = 512000                              {product}

     bool CollectGen0First                          = false                               {product}

     bool CompactFields                             = true                                {product}

     intx CompilationPolicyChoice                   = 3                                   {product}

ccstrlist CompileCommand                            =                                     {product}

    ccstr CompileCommandFile                        =                                     {product}

ccstrlist CompileOnly                               =                                     {product}

     intx CompileThreshold                          = 10000                               {pd product}

     bool CompilerThreadHintNoPreempt               = true                                {product}

     intx CompilerThreadPriority                    = -1                                  {product}

     intx CompilerThreadStackSize                   = 0                                   {pd product}

    uintx CompressedClassSpaceSize                  = 1073741824                          {product}

    uintx ConcGCThreads                             = 0                                   {product}

     intx ConditionalMoveLimit                      = 3                                   {C2 pd product}

     intx ContendedPaddingWidth                     = 128                                 {product}

     bool ConvertSleepToYield                       = true                                {pd product}

     bool ConvertYieldToSleep                       = false                               {product}

     bool CrashOnOutOfMemoryError                   = false                               {product}

     bool CreateMinidumpOnCrash                     = false                               {product}

     bool CriticalJNINatives                        = true                                {product}

     bool DTraceAllocProbes                         = false                               {product}

     bool DTraceMethodProbes                        = false                               {product}

     bool DTraceMonitorProbes                       = false                               {product}

     bool Debugging                                 = false                               {product}

    uintx DefaultMaxRAMFraction                     = 4                                   {product}

     intx DefaultThreadPriority                     = -1                                  {product}

     intx DeferPollingPageLoopCount                 = -1                                  {product}

     intx DeferThrSuspendLoopCount                  = 4000                                {product}

     bool DeoptimizeRandom                          = false                               {product}

     bool DisableAttachMechanism                    = false                               {product}

     bool DisableExplicitGC                         = false                               {product}

     bool DisplayVMOutputToStderr                   = false                               {product}

     bool DisplayVMOutputToStdout                   = false                               {product}

     bool DoEscapeAnalysis                          = true                                {C2 product}

     bool DontCompileHugeMethods                    = true                                {product}

     bool DontYieldALot                             = false                               {pd product}

    ccstr DumpLoadedClassList                       =                                     {product}

     bool DumpReplayDataOnError                     = true                                {product}

     bool DumpSharedSpaces                          = false                               {product}

     bool EagerXrunInit                             = false                               {product}

     intx EliminateAllocationArraySizeLimit         = 64                                  {C2 product}

     bool EliminateAllocations                      = true                                {C2 product}

     bool EliminateAutoBox                          = true                                {C2 product}

     bool EliminateLocks                            = true                                {C2 product}

     bool EliminateNestedLocks                      = true                                {C2 product}

     intx EmitSync                                  = 0                                   {product}

     bool EnableContended                           = true                                {product}

     bool EnableResourceManagementTLABCache         = true                                {product}

     bool EnableSharedLookupCache                   = true                                {product}

     bool EnableTracing                             = false                               {product}

    uintx ErgoHeapSizeLimit                         = 0                                   {product}

    ccstr ErrorFile                                 =                                     {product}

    ccstr ErrorReportServer                         =                                     {product}

   double EscapeAnalysisTimeout                     = 20.000000                           {C2 product}

     bool EstimateArgEscape                         = true                                {product}

     bool ExitOnOutOfMemoryError                    = false                               {product}

     bool ExplicitGCInvokesConcurrent               = false                               {product}

     bool ExplicitGCInvokesConcurrentAndUnloadsClasses  = false                               {product}

     bool ExtendedDTraceProbes                      = false                               {product}

    ccstr ExtraSharedClassListFile                  =                                     {product}

     bool FLSAlwaysCoalesceLarge                    = false                               {product}

    uintx FLSCoalescePolicy                         = 2                                   {product}

   double FLSLargestBlockCoalesceProximity          = 0.990000                            {product}

     bool FailOverToOldVerifier                     = true                                {product}

     bool FastTLABRefill                            = true                                {product}

     intx FenceInstruction                          = 0                                   {ARCH product}

     intx FieldsAllocationStyle                     = 1                                   {product}

     bool FilterSpuriousWakeups                     = true                                {product}

    ccstr FlightRecorderOptions                     =                                     {product}

     bool ForceNUMA                                 = false                               {product}

     bool ForceTimeHighResolution                   = false                               {product}

     intx FreqInlineSize                            = 325                                 {pd product}

   double G1ConcMarkStepDurationMillis              = 10.000000                           {product}

    uintx G1ConcRSHotCardLimit                      = 4                                   {product}

    uintx G1ConcRSLogCacheSize                      = 10                                  {product}

     intx G1ConcRefinementGreenZone                 = 0                                   {product}

     intx G1ConcRefinementRedZone                   = 0                                   {product}

     intx G1ConcRefinementServiceIntervalMillis     = 300                                 {product}

    uintx G1ConcRefinementThreads                   = 0                                   {product}

     intx G1ConcRefinementThresholdStep             = 0                                   {product}

     intx G1ConcRefinementYellowZone                = 0                                   {product}

    uintx G1ConfidencePercent                       = 50                                  {product}

    uintx G1HeapRegionSize                          = 0                                   {product}

    uintx G1HeapWastePercent                        = 5                                   {product}

    uintx G1MixedGCCountTarget                      = 8                                   {product}

     intx G1RSetRegionEntries                       = 0                                   {product}

    uintx G1RSetScanBlockSize                       = 64                                  {product}

     intx G1RSetSparseRegionEntries                 = 0                                   {product}

     intx G1RSetUpdatingPauseTimePercent            = 10                                  {product}

     intx G1RefProcDrainInterval                    = 10                                  {product}

    uintx G1ReservePercent                          = 10                                  {product}

    uintx G1SATBBufferEnqueueingThresholdPercent    = 60                                  {product}

     intx G1SATBBufferSize                          = 1024                                {product}

     intx G1UpdateBufferSize                        = 256                                 {product}

     bool G1UseAdaptiveConcRefinement               = true                                {product}

    uintx GCDrainStackTargetSize                    = 64                                  {product}

    uintx GCHeapFreeLimit                           = 2                                   {product}

    uintx GCLockerEdenExpansionPercent              = 5                                   {product}

     bool GCLockerInvokesConcurrent                 = false                               {product}

    uintx GCLogFileSize                             = 8192                                {product}

    uintx GCPauseIntervalMillis                     = 0                                   {product}

    uintx GCTaskTimeStampEntries                    = 200                                 {product}

    uintx GCTimeLimit                               = 98                                  {product}

    uintx GCTimeRatio                               = 99                                  {product}

    uintx HeapBaseMinAddress                        = 2147483648                          {pd product}

     bool HeapDumpAfterFullGC                       = false                               {manageable}

     bool HeapDumpBeforeFullGC                      = false                               {manageable}

     bool HeapDumpOnOutOfMemoryError                = false                               {manageable}

    ccstr HeapDumpPath                              =                                     {manageable}

    uintx HeapFirstMaximumCompactionCount           = 3                                   {product}

    uintx HeapMaximumCompactionInterval             = 20                                  {product}

    uintx HeapSizePerGCThread                       = 87241520                            {product}

     bool IgnoreEmptyClassPaths                     = false                               {product}

     bool IgnoreUnrecognizedVMOptions               = false                               {product}

    uintx IncreaseFirstTierCompileThresholdAt       = 50                                  {product}

     bool IncrementalInline                         = true                                {C2 product}

    uintx InitialBootClassLoaderMetaspaceSize       = 4194304                             {product}

    uintx InitialCodeCacheSize                      = 2555904                             {pd product}

    uintx InitialHeapSize                          := 268435456                           {product}

    uintx InitialRAMFraction                        = 64                                  {product}

    uintx InitialSurvivorRatio                      = 8                                   {product}

    uintx InitialTenuringThreshold                  = 7                                   {product}

    uintx InitiatingHeapOccupancyPercent            = 45                                  {product}

     bool Inline                                    = true                                {product}

    ccstr InlineDataFile                            =                                     {product}

     intx InlineSmallCode                           = 2000                                {pd product}

     bool InlineSynchronizedMethods                 = true                                {C1 product}

     bool InsertMemBarAfterArraycopy                = true                                {C2 product}

     intx InteriorEntryAlignment                    = 16                                  {C2 pd product}

     intx InterpreterProfilePercentage              = 33                                  {product}

     bool JNIDetachReleasesMonitors                 = true                                {product}

     bool JavaMonitorsInStackTrace                  = true                                {product}

     intx JavaPriority10_To_OSPriority              = -1                                  {product}

     intx JavaPriority1_To_OSPriority               = -1                                  {product}

     intx JavaPriority2_To_OSPriority               = -1                                  {product}

     intx JavaPriority3_To_OSPriority               = -1                                  {product}

     intx JavaPriority4_To_OSPriority               = -1                                  {product}

     intx JavaPriority5_To_OSPriority               = -1                                  {product}

     intx JavaPriority6_To_OSPriority               = -1                                  {product}

     intx JavaPriority7_To_OSPriority               = -1                                  {product}

     intx JavaPriority8_To_OSPriority               = -1                                  {product}

     intx JavaPriority9_To_OSPriority               = -1                                  {product}

     bool LIRFillDelaySlots                         = false                               {C1 pd product}

    uintx LargePageHeapSizeThreshold                = 134217728                           {product}

    uintx LargePageSizeInBytes                      = 0                                   {product}

     bool LazyBootClassLoader                       = true                                {product}

     intx LiveNodeCountInliningCutoff               = 40000                               {C2 product}

     bool LogCommercialFeatures                     = false                               {product}

     intx LoopMaxUnroll                             = 16                                  {C2 product}

     intx LoopOptsCount                             = 43                                  {C2 product}

     intx LoopUnrollLimit                           = 60                                  {C2 pd product}

     intx LoopUnrollMin                             = 4                                   {C2 product}

     bool LoopUnswitching                           = true                                {C2 product}

     bool ManagementServer                          = false                               {product}

    uintx MarkStackSize                             = 4194304                             {product}

    uintx MarkStackSizeMax                          = 536870912                           {product}

    uintx MarkSweepAlwaysCompactCount               = 4                                   {product}

    uintx MarkSweepDeadRatio                        = 1                                   {product}

     intx MaxBCEAEstimateLevel                      = 5                                   {product}

     intx MaxBCEAEstimateSize                       = 150                                 {product}

    uintx MaxDirectMemorySize                       = 0                                   {product}

     bool MaxFDLimit                                = true                                {product}

    uintx MaxGCMinorPauseMillis                     = 18446744073709551615                    {product}

    uintx MaxGCPauseMillis                          = 18446744073709551615                    {product}

    uintx MaxHeapFreeRatio                          = 100                                 {manageable}

    uintx MaxHeapSize                              := 4294967296                          {product}

     intx MaxInlineLevel                            = 9                                   {product}

     intx MaxInlineSize                             = 35                                  {product}

     intx MaxJNILocalCapacity                       = 65536                               {product}

     intx MaxJavaStackTraceDepth                    = 1024                                {product}

     intx MaxJumpTableSize                          = 65000                               {C2 product}

     intx MaxJumpTableSparseness                    = 5                                   {C2 product}

     intx MaxLabelRootDepth                         = 1100                                {C2 product}

     intx MaxLoopPad                                = 11                                  {C2 product}

    uintx MaxMetaspaceExpansion                     = 5451776                             {product}

    uintx MaxMetaspaceFreeRatio                     = 70                                  {product}

    uintx MaxMetaspaceSize                          = 18446744073709547520                    {product}

    uintx MaxNewSize                               := 1431306240                          {product}

     intx MaxNodeLimit                              = 75000                               {C2 product}

 uint64_t MaxRAM                                    = 137438953472                        {pd product}

    uintx MaxRAMFraction                            = 4                                   {product}

     intx MaxRecursiveInlineLevel                   = 1                                   {product}

    uintx MaxTenuringThreshold                      = 15                                  {product}

     intx MaxTrivialSize                            = 6                                   {product}

     intx MaxVectorSize                             = 32                                  {C2 product}

    uintx MetaspaceSize                             = 21807104                            {pd product}

     bool MethodFlushing                            = true                                {product}

    uintx MinHeapDeltaBytes                        := 524288                              {product}

    uintx MinHeapFreeRatio                          = 0                                   {manageable}

     intx MinInliningThreshold                      = 250                                 {product}

     intx MinJumpTableSize                          = 10                                  {C2 pd product}

    uintx MinMetaspaceExpansion                     = 339968                              {product}

    uintx MinMetaspaceFreeRatio                     = 40                                  {product}

    uintx MinRAMFraction                            = 2                                   {product}

    uintx MinSurvivorRatio                          = 3                                   {product}

    uintx MinTLABSize                               = 2048                                {product}

     intx MonitorBound                              = 0                                   {product}

     bool MonitorInUseLists                         = false                               {product}

     intx MultiArrayExpandLimit                     = 6                                   {C2 product}

     bool MustCallLoadClassInternal                 = false                               {product}

    uintx NUMAChunkResizeWeight                     = 20                                  {product}

    uintx NUMAInterleaveGranularity                 = 2097152                             {product}

    uintx NUMAPageScanRate                          = 256                                 {product}

    uintx NUMASpaceResizeRate                       = 1073741824                          {product}

     bool NUMAStats                                 = false                               {product}

    ccstr NativeMemoryTracking                      = off                                 {product}

     bool NeedsDeoptSuspend                         = false                               {pd product}

     bool NeverActAsServerClassMachine              = false                               {pd product}

     bool NeverTenure                               = false                               {product}

    uintx NewRatio                                  = 2                                   {product}

    uintx NewSize                                  := 89128960                            {product}

    uintx NewSizeThreadIncrease                     = 5320                                {pd product}

     intx NmethodSweepActivity                      = 10                                  {product}

     intx NmethodSweepCheckInterval                 = 5                                   {product}

     intx NmethodSweepFraction                      = 16                                  {product}

     intx NodeLimitFudgeFactor                      = 2000                                {C2 product}

    uintx NumberOfGCLogFiles                        = 0                                   {product}

     intx NumberOfLoopInstrToAlign                  = 4                                   {C2 product}

     intx ObjectAlignmentInBytes                    = 8                                   {lp64_product}

    uintx OldPLABSize                               = 1024                                {product}

    uintx OldPLABWeight                             = 50                                  {product}

    uintx OldSize                                  := 179306496                           {product}

     bool OmitStackTraceInFastThrow                 = true                                {product}

ccstrlist OnError                                   =                                     {product}

ccstrlist OnOutOfMemoryError                        =                                     {product}

     intx OnStackReplacePercentage                  = 140                                 {pd product}

     bool OptimizeFill                              = true                                {C2 product}

     bool OptimizePtrCompare                        = true                                {C2 product}

     bool OptimizeStringConcat                      = true                                {C2 product}

     bool OptoBundling                              = false                               {C2 pd product}

     intx OptoLoopAlignment                         = 16                                  {pd product}

     bool OptoScheduling                            = false                               {C2 pd product}

    uintx PLABWeight                                = 75                                  {product}

     bool PSChunkLargeArrays                        = true                                {product}

     intx ParGCArrayScanChunk                       = 50                                  {product}

    uintx ParGCDesiredObjsFromOverflowList          = 20                                  {product}

     bool ParGCTrimOverflow                         = true                                {product}

     bool ParGCUseLocalOverflow                     = false                               {product}

    uintx ParallelGCBufferWastePct                  = 10                                  {product}

    uintx ParallelGCThreads                         = 8                                   {product}

     bool ParallelGCVerbose                         = false                               {product}

    uintx ParallelOldDeadWoodLimiterMean            = 50                                  {product}

    uintx ParallelOldDeadWoodLimiterStdDev          = 80                                  {product}

     bool ParallelRefProcBalancingEnabled           = true                                {product}

     bool ParallelRefProcEnabled                    = false                               {product}

     bool PartialPeelAtUnsignedTests                = true                                {C2 product}

     bool PartialPeelLoop                           = true                                {C2 product}

     intx PartialPeelNewPhiDelta                    = 0                                   {C2 product}

    uintx PausePadding                              = 1                                   {product}

     intx PerBytecodeRecompilationCutoff            = 200                                 {product}

     intx PerBytecodeTrapLimit                      = 4                                   {product}

     intx PerMethodRecompilationCutoff              = 400                                 {product}

     intx PerMethodTrapLimit                        = 100                                 {product}

     bool PerfAllowAtExitRegistration               = false                               {product}

     bool PerfBypassFileSystemCheck                 = false                               {product}

     intx PerfDataMemorySize                        = 32768                               {product}

     intx PerfDataSamplingInterval                  = 50                                  {product}

    ccstr PerfDataSaveFile                          =                                     {product}

     bool PerfDataSaveToFile                        = false                               {product}

     bool PerfDisableSharedMem                      = false                               {product}

     intx PerfMaxStringConstLength                  = 1024                                {product}

     intx PreInflateSpin                            = 10                                  {pd product}

     bool PreferInterpreterNativeStubs              = false                               {pd product}

     intx PrefetchCopyIntervalInBytes               = 576                                 {product}

     intx PrefetchFieldsAhead                       = 1                                   {product}

     intx PrefetchScanIntervalInBytes               = 576                                 {product}

     bool PreserveAllAnnotations                    = false                               {product}

     bool PreserveFramePointer                      = false                               {pd product}

    uintx PretenureSizeThreshold                    = 0                                   {product}

     bool PrintAdaptiveSizePolicy                   = false                               {product}

     bool PrintCMSInitiationStatistics              = false                               {product}

     intx PrintCMSStatistics                        = 0                                   {product}

     bool PrintClassHistogram                       = false                               {manageable}

     bool PrintClassHistogramAfterFullGC            = false                               {manageable}

     bool PrintClassHistogramBeforeFullGC           = false                               {manageable}

     bool PrintCodeCache                            = false                               {product}

     bool PrintCodeCacheOnCompilation               = false                               {product}

     bool PrintCommandLineFlags                     = false                               {product}

     bool PrintCompilation                          = false                               {product}

     bool PrintConcurrentLocks                      = false                               {manageable}

     intx PrintFLSCensus                            = 0                                   {product}

     intx PrintFLSStatistics                        = 0                                   {product}

     bool PrintFlagsFinal                          := true                                {product}

     bool PrintFlagsInitial                         = false                               {product}

     bool PrintGC                                   = false                               {manageable}

     bool PrintGCApplicationConcurrentTime          = false                               {product}

     bool PrintGCApplicationStoppedTime             = false                               {product}

     bool PrintGCCause                              = true                                {product}

     bool PrintGCDateStamps                         = false                               {manageable}

     bool PrintGCDetails                            = false                               {manageable}

     bool PrintGCID                                 = false                               {manageable}

     bool PrintGCTaskTimeStamps                     = false                               {product}

     bool PrintGCTimeStamps                         = false                               {manageable}

     bool PrintHeapAtGC                             = false                               {product rw}

     bool PrintHeapAtGCExtended                     = false                               {product rw}

     bool PrintHeapAtSIGBREAK                       = true                                {product}

     bool PrintJNIGCStalls                          = false                               {product}

     bool PrintJNIResolving                         = false                               {product}

     bool PrintOldPLAB                              = false                               {product}

     bool PrintOopAddress                           = false                               {product}

     bool PrintPLAB                                 = false                               {product}

     bool PrintParallelOldGCPhaseTimes              = false                               {product}

     bool PrintPromotionFailure                     = false                               {product}

     bool PrintReferenceGC                          = false                               {product}

     bool PrintSafepointStatistics                  = false                               {product}

     intx PrintSafepointStatisticsCount             = 300                                 {product}

     intx PrintSafepointStatisticsTimeout           = -1                                  {product}

     bool PrintSharedArchiveAndExit                 = false                               {product}

     bool PrintSharedDictionary                     = false                               {product}

     bool PrintSharedSpaces                         = false                               {product}

     bool PrintStringDeduplicationStatistics        = false                               {product}

     bool PrintStringTableStatistics                = false                               {product}

     bool PrintTLAB                                 = false                               {product}

     bool PrintTenuringDistribution                 = false                               {product}

     bool PrintTieredEvents                         = false                               {product}

     bool PrintVMOptions                            = false                               {product}

     bool PrintVMQWaitTime                          = false                               {product}

     bool PrintWarnings                             = true                                {product}

    uintx ProcessDistributionStride                 = 4                                   {product}

     bool ProfileInterpreter                        = true                                {pd product}

     bool ProfileIntervals                          = false                               {product}

     intx ProfileIntervalsTicks                     = 100                                 {product}

     intx ProfileMaturityPercentage                 = 20                                  {product}

     bool ProfileVM                                 = false                               {product}

     bool ProfilerPrintByteCodeStatistics           = false                               {product}

     bool ProfilerRecordPC                          = false                               {product}

    uintx PromotedPadding                           = 3                                   {product}

    uintx QueuedAllocationWarningCount              = 0                                   {product}

    uintx RTMRetryCount                             = 5                                   {ARCH product}

     bool RangeCheckElimination                     = true                                {product}

     intx ReadPrefetchInstr                         = 0                                   {ARCH product}

     bool ReassociateInvariants                     = true                                {C2 product}

     bool ReduceBulkZeroing                         = true                                {C2 product}

     bool ReduceFieldZeroing                        = true                                {C2 product}

     bool ReduceInitialCardMarks                    = true                                {C2 product}

     bool ReduceSignalUsage                         = false                               {product}

     intx RefDiscoveryPolicy                        = 0                                   {product}

     bool ReflectionWrapResolutionErrors            = true                                {product}

     bool RegisterFinalizersAtInit                  = true                                {product}

     bool RelaxAccessControlCheck                   = false                               {product}

    ccstr ReplayDataFile                            =                                     {product}

     bool RequireSharedSpaces                       = false                               {product}

    uintx ReservedCodeCacheSize                     = 251658240                           {pd product}

     bool ResizeOldPLAB                             = true                                {product}

     bool ResizePLAB                                = true                                {product}

     bool ResizeTLAB                                = true                                {pd product}

     bool RestoreMXCSROnJNICalls                    = false                               {product}

     bool RestrictContended                         = true                                {product}

     bool RewriteBytecodes                          = true                                {pd product}

     bool RewriteFrequentPairs                      = true                                {pd product}

     intx SafepointPollOffset                       = 256                                 {C1 pd product}

     intx SafepointSpinBeforeYield                  = 2000                                {product}

     bool SafepointTimeout                          = false                               {product}

     intx SafepointTimeoutDelay                     = 10000                               {product}

     bool ScavengeBeforeFullGC                      = true                                {product}

     intx SelfDestructTimer                         = 0                                   {product}

    uintx SharedBaseAddress                         = 34359738368                         {product}

    ccstr SharedClassListFile                       =                                     {product}

    uintx SharedMiscCodeSize                        = 122880                              {product}

    uintx SharedMiscDataSize                        = 4194304                             {product}

    uintx SharedReadOnlySize                        = 16777216                            {product}

    uintx SharedReadWriteSize                       = 16777216                            {product}

     bool ShowMessageBoxOnError                     = false                               {product}

     intx SoftRefLRUPolicyMSPerMB                   = 1000                                {product}

     bool SpecialEncodeISOArray                     = true                                {C2 product}

     bool SplitIfBlocks                             = true                                {C2 product}

     intx StackRedPages                             = 1                                   {pd product}

     intx StackShadowPages                          = 20                                  {pd product}

     bool StackTraceInThrowable                     = true                                {product}

     intx StackYellowPages                          = 2                                   {pd product}

     bool StartAttachListener                       = false                               {product}

     intx StarvationMonitorInterval                 = 200                                 {product}

     bool StressLdcRewrite                          = false                               {product}

    uintx StringDeduplicationAgeThreshold           = 3                                   {product}

    uintx StringTableSize                           = 60013                               {product}

     bool SuppressFatalErrorMessage                 = false                               {product}

    uintx SurvivorPadding                           = 3                                   {product}

    uintx SurvivorRatio                             = 8                                   {product}

     intx SuspendRetryCount                         = 50                                  {product}

     intx SuspendRetryDelay                         = 5                                   {product}

     intx SyncFlags                                 = 0                                   {product}

    ccstr SyncKnobs                                 =                                     {product}

     intx SyncVerbose                               = 0                                   {product}

    uintx TLABAllocationWeight                      = 35                                  {product}

    uintx TLABRefillWasteFraction                   = 64                                  {product}

    uintx TLABSize                                  = 0                                   {product}

     bool TLABStats                                 = true                                {product}

    uintx TLABWasteIncrement                        = 4                                   {product}

    uintx TLABWasteTargetPercent                    = 1                                   {product}

    uintx TargetPLABWastePct                        = 10                                  {product}

    uintx TargetSurvivorRatio                       = 50                                  {product}

    uintx TenuredGenerationSizeIncrement            = 20                                  {product}

    uintx TenuredGenerationSizeSupplement           = 80                                  {product}

    uintx TenuredGenerationSizeSupplementDecay      = 2                                   {product}

     intx ThreadPriorityPolicy                      = 0                                   {product}

     bool ThreadPriorityVerbose                     = false                               {product}

    uintx ThreadSafetyMargin                        = 52428800                            {product}

     intx ThreadStackSize                           = 1024                                {pd product}

    uintx ThresholdTolerance                        = 10                                  {product}

     intx Tier0BackedgeNotifyFreqLog                = 10                                  {product}

     intx Tier0InvokeNotifyFreqLog                  = 7                                   {product}

     intx Tier0ProfilingStartPercentage             = 200                                 {product}

     intx Tier23InlineeNotifyFreqLog                = 20                                  {product}

     intx Tier2BackEdgeThreshold                    = 0                                   {product}

     intx Tier2BackedgeNotifyFreqLog                = 14                                  {product}

     intx Tier2CompileThreshold                     = 0                                   {product}

     intx Tier2InvokeNotifyFreqLog                  = 11                                  {product}

     intx Tier3BackEdgeThreshold                    = 60000                               {product}

     intx Tier3BackedgeNotifyFreqLog                = 13                                  {product}

     intx Tier3CompileThreshold                     = 2000                                {product}

     intx Tier3DelayOff                             = 2                                   {product}

     intx Tier3DelayOn                              = 5                                   {product}

     intx Tier3InvocationThreshold                  = 200                                 {product}

     intx Tier3InvokeNotifyFreqLog                  = 10                                  {product}

     intx Tier3LoadFeedback                         = 5                                   {product}

     intx Tier3MinInvocationThreshold               = 100                                 {product}

     intx Tier4BackEdgeThreshold                    = 40000                               {product}

     intx Tier4CompileThreshold                     = 15000                               {product}

     intx Tier4InvocationThreshold                  = 5000                                {product}

     intx Tier4LoadFeedback                         = 3                                   {product}

     intx Tier4MinInvocationThreshold               = 600                                 {product}

     bool TieredCompilation                         = true                                {pd product}

     intx TieredCompileTaskTimeout                  = 50                                  {product}

     intx TieredRateUpdateMaxTime                   = 25                                  {product}

     intx TieredRateUpdateMinTime                   = 1                                   {product}

     intx TieredStopAtLevel                         = 4                                   {product}

     bool TimeLinearScan                            = false                               {C1 product}

     bool TraceBiasedLocking                        = false                               {product}

     bool TraceClassLoading                         = false                               {product rw}

     bool TraceClassLoadingPreorder                 = false                               {product}

     bool TraceClassPaths                           = false                               {product}

     bool TraceClassResolution                      = false                               {product}

     bool TraceClassUnloading                       = false                               {product rw}

     bool TraceDynamicGCThreads                     = false                               {product}

     bool TraceGen0Time                             = false                               {product}

     bool TraceGen1Time                             = false                               {product}

    ccstr TraceJVMTI                                =                                     {product}

     bool TraceLoaderConstraints                    = false                               {product rw}

     bool TraceMetadataHumongousAllocation          = false                               {product}

     bool TraceMonitorInflation                     = false                               {product}

     bool TraceParallelOldGCTasks                   = false                               {product}

     intx TraceRedefineClasses                      = 0                                   {product}

     bool TraceSafepointCleanupTime                 = false                               {product}

     bool TraceSharedLookupCache                    = false                               {product}

     bool TraceSuspendWaitFailures                  = false                               {product}

     intx TrackedInitializationLimit                = 50                                  {C2 product}

     bool TransmitErrorReport                       = false                               {product}

     bool TrapBasedNullChecks                       = false                               {pd product}

     bool TrapBasedRangeChecks                      = false                               {C2 pd product}

     intx TypeProfileArgsLimit                      = 2                                   {product}

    uintx TypeProfileLevel                          = 111                                 {pd product}

     intx TypeProfileMajorReceiverPercent           = 90                                  {C2 product}

     intx TypeProfileParmsLimit                     = 2                                   {product}

     intx TypeProfileWidth                          = 2                                   {product}

     intx UnguardOnExecutionViolation               = 0                                   {product}

     bool UnlinkSymbolsALot                         = false                               {product}

     bool Use486InstrsOnly                          = false                               {ARCH product}

     bool UseAES                                    = true                                {product}

     bool UseAESIntrinsics                          = true                                {product}

     intx UseAVX                                    = 2                                   {ARCH product}

     bool UseAdaptiveGCBoundary                     = false                               {product}

     bool UseAdaptiveGenerationSizePolicyAtMajorCollection  = true                                {product}

     bool UseAdaptiveGenerationSizePolicyAtMinorCollection  = true                                {product}

     bool UseAdaptiveNUMAChunkSizing                = true                                {product}

     bool UseAdaptiveSizeDecayMajorGCCost           = true                                {product}

     bool UseAdaptiveSizePolicy                     = true                                {product}

     bool UseAdaptiveSizePolicyFootprintGoal        = true                                {product}

     bool UseAdaptiveSizePolicyWithSystemGC         = false                               {product}

     bool UseAddressNop                             = true                                {ARCH product}

     bool UseAltSigs                                = false                               {product}

     bool UseAutoGCSelectPolicy                     = false                               {product}

     bool UseBMI1Instructions                       = true                                {ARCH product}

     bool UseBMI2Instructions                       = true                                {ARCH product}

     bool UseBiasedLocking                          = true                                {product}

     bool UseBimorphicInlining                      = true                                {C2 product}

     bool UseBoundThreads                           = true                                {product}

     bool UseBsdPosixThreadCPUClocks                = true                                {product}

     bool UseCLMUL                                  = true                                {ARCH product}

     bool UseCMSBestFit                             = true                                {product}

     bool UseCMSCollectionPassing                   = true                                {product}

     bool UseCMSCompactAtFullCollection             = true                                {product}

     bool UseCMSInitiatingOccupancyOnly             = false                               {product}

     bool UseCRC32Intrinsics                        = true                                {product}

     bool UseCodeCacheFlushing                      = true                                {product}

     bool UseCompiler                               = true                                {product}

     bool UseCompilerSafepoints                     = true                                {product}

     bool UseCompressedClassPointers               := true                                {lp64_product}

     bool UseCompressedOops                        := true                                {lp64_product}

     bool UseConcMarkSweepGC                        = false                               {product}

     bool UseCondCardMark                           = false                               {C2 product}

     bool UseCountLeadingZerosInstruction           = true                                {ARCH product}

     bool UseCountTrailingZerosInstruction          = true                                {ARCH product}

     bool UseCountedLoopSafepoints                  = false                               {C2 product}

     bool UseCounterDecay                           = true                                {product}

     bool UseDivMod                                 = true                                {C2 product}

     bool UseDynamicNumberOfGCThreads               = false                               {product}

     bool UseFPUForSpilling                         = true                                {C2 product}

     bool UseFastAccessorMethods                    = false                               {product}

     bool UseFastEmptyMethods                       = false                               {product}

     bool UseFastJNIAccessors                       = true                                {product}

     bool UseFastStosb                              = true                                {ARCH product}

     bool UseG1GC                                   = false                               {product}

     bool UseGCLogFileRotation                      = false                               {product}

     bool UseGCOverheadLimit                        = true                                {product}

     bool UseGCTaskAffinity                         = false                               {product}

     bool UseHeavyMonitors                          = false                               {product}

     bool UseHugeTLBFS                              = false                               {product}

     bool UseInlineCaches                           = true                                {product}

     bool UseInterpreter                            = true                                {product}

     bool UseJumpTables                             = true                                {C2 product}

     bool UseLWPSynchronization                     = true                                {product}

     bool UseLargePages                             = false                               {pd product}

     bool UseLargePagesInMetaspace                  = false                               {product}

     bool UseLargePagesIndividualAllocation         = false                               {pd product}

     bool UseLockedTracing                          = false                               {product}

     bool UseLoopCounter                            = true                                {product}

     bool UseLoopInvariantCodeMotion                = true                                {C1 product}

     bool UseLoopPredicate                          = true                                {C2 product}

     bool UseMathExactIntrinsics                    = true                                {C2 product}

     bool UseMaximumCompactionOnSystemGC            = true                                {product}

     bool UseMembar                                 = true                                {pd product}

     bool UseMontgomeryMultiplyIntrinsic            = true                                {C2 product}

     bool UseMontgomerySquareIntrinsic              = true                                {C2 product}

     bool UseMulAddIntrinsic                        = true                                {C2 product}

     bool UseMultiplyToLenIntrinsic                 = true                                {C2 product}

     bool UseNUMA                                   = false                               {product}

     bool UseNUMAInterleaving                       = false                               {product}

     bool UseNewLongLShift                          = false                               {ARCH product}

     bool UseOSErrorReporting                       = false                               {pd product}

     bool UseOldInlining                            = true                                {C2 product}

     bool UseOnStackReplacement                     = true                                {pd product}

     bool UseOnlyInlinedBimorphic                   = true                                {C2 product}

     bool UseOprofile                               = false                               {product}

     bool UseOptoBiasInlining                       = true                                {C2 product}

     bool UsePSAdaptiveSurvivorSizePolicy           = true                                {product}

     bool UseParNewGC                               = false                               {product}

     bool UseParallelGC                            := true                                {product}

     bool UseParallelOldGC                          = true                                {product}

     bool UsePerfData                               = true                                {product}

     bool UsePopCountInstruction                    = true                                {product}

     bool UseRDPCForConstantTableBase               = false                               {C2 product}

     bool UseRTMDeopt                               = false                               {ARCH product}

     bool UseRTMLocking                             = false                               {ARCH product}

     bool UseSHA                                    = false                               {product}

     bool UseSHA1Intrinsics                         = false                               {product}

     bool UseSHA256Intrinsics                       = false                               {product}

     bool UseSHA512Intrinsics                       = false                               {product}

     bool UseSHM                                    = false                               {product}

     intx UseSSE                                    = 4                                   {product}

     bool UseSSE42Intrinsics                        = true                                {product}

     bool UseSerialGC                               = false                               {product}

     bool UseSharedSpaces                           = false                               {product}

     bool UseSignalChaining                         = true                                {product}

     bool UseSquareToLenIntrinsic                   = true                                {C2 product}

     bool UseStoreImmI16                            = false                               {ARCH product}

     bool UseStringDeduplication                    = false                               {product}

     bool UseSuperWord                              = true                                {C2 product}

     bool UseTLAB                                   = true                                {pd product}

     bool UseThreadPriorities                       = true                                {pd product}

     bool UseTypeProfile                            = true                                {product}

     bool UseTypeSpeculation                        = true                                {C2 product}

     bool UseUnalignedLoadStores                    = true                                {ARCH product}

     bool UseVMInterruptibleIO                      = false                               {product}

     bool UseXMMForArrayCopy                        = true                                {product}

     bool UseXmmI2D                                 = false                               {ARCH product}

     bool UseXmmI2F                                 = false                               {ARCH product}

     bool UseXmmLoadAndClearUpper                   = true                                {ARCH product}

     bool UseXmmRegToRegMoveAll                     = true                                {ARCH product}

     bool VMThreadHintNoPreempt                     = false                               {product}

     intx VMThreadPriority                          = -1                                  {product}

     intx VMThreadStackSize                         = 1024                                {pd product}

     intx ValueMapInitialSize                       = 11                                  {C1 product}

     intx ValueMapMaxLoopSize                       = 8                                   {C1 product}

     intx ValueSearchLimit                          = 1000                                {C2 product}

     bool VerifyMergedCPBytecodes                   = true                                {product}

     bool VerifySharedSpaces                        = false                               {product}

     intx WorkAroundNPTLTimedWaitHang               = 1                                   {product}

    uintx YoungGenerationSizeIncrement              = 20                                  {product}

    uintx YoungGenerationSizeSupplement             = 80                                  {product}

    uintx YoungGenerationSizeSupplementDecay        = 8                                   {product}

    uintx YoungPLABSize                             = 4096                                {product}

     bool ZeroTLAB                                  = false                               {product}

     intx hashCode                                  = 5                                   {product}

java version "1.8.0_172"

Java(TM) SE Runtime Environment (build 1.8.0_172-b11)

Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

:

[Java] BufferedReader 사용 시 size 설정

ITWeb/개발일반 2018. 7. 17. 08:34

Text 파일을 라인 단위로 읽어 들이기 위해 많이 사용하는 클래스 입니다.

보통은 default 생성자로 사용을 하는데 라인 한줄이 너무 커서 크기를 조정해 줘야 했습니다.

혹시 잊을까봐 기록해 봅니다.


https://docs.oracle.com/javase/8/docs/api/java/io/BufferedReader.html


BufferedReader(Reader in)


BufferedReader(Reader in, int sz)


JDK8 기준으로 default size  는 8192 bytes 입니다.


private static int defaultCharBufferSize = 8192;


:

[Elasticsearch] JSON 스트링으로 질의요청

Elastic/Elasticsearch 2018. 4. 3. 13:41

예전에도 JSON 스트링을 가지고 setSource() 함수로 질의 했었는데요.

필요하신 분들이 계신것 같아 쉬운 샘플 코드 올려 봅니다.


[Source Code]

package org.elasticsearch.action.search;

import org.elasticsearch.client.Client;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.TermQueryBuilder;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.transport.client.PreBuiltTransportClient;

public class HelloSearchSourceBuilder {

public static void main (String[] args) {
Client client;
client = new PreBuiltTransportClient(Settings.EMPTY);

SearchRequestBuilder searchRequestBuilder = client.prepareSearch();
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
TermQueryBuilder termQueryBuilder = QueryBuilders.termQuery("field1","value1");

System.out.println(termQueryBuilder.toString());

searchSourceBuilder.query(termQueryBuilder).from(0).size(10);

System.out.println(searchSourceBuilder.toString());

searchRequestBuilder.setSource(searchSourceBuilder);

System.out.println(searchRequestBuilder.toString());
}
}


[Output]

[2018-04-03T13:36:38,466][INFO ][o.e.p.PluginsService     ] [_client_] no modules loaded

[2018-04-03T13:36:38,470][INFO ][o.e.p.PluginsService     ] [_client_] loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]

[2018-04-03T13:36:38,470][INFO ][o.e.p.PluginsService     ] [_client_] loaded plugin [org.elasticsearch.join.ParentJoinPlugin]

[2018-04-03T13:36:38,470][INFO ][o.e.p.PluginsService     ] [_client_] loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]

[2018-04-03T13:36:38,470][INFO ][o.e.p.PluginsService     ] [_client_] loaded plugin [org.elasticsearch.script.mustache.MustachePlugin]

[2018-04-03T13:36:38,470][INFO ][o.e.p.PluginsService     ] [_client_] loaded plugin [org.elasticsearch.transport.Netty4Plugin]

{

  "term" : {

    "field1" : {

      "value" : "value1",

      "boost" : 1.0

    }

  }

}

{"from":0,"size":10,"query":{"term":{"field1":{"value":"value1","boost":1.0}}}}

{"from":0,"size":10,"query":{"term":{"field1":{"value":"value1","boost":1.0}}}}


Process finished with exit code 0



:

[GC] 관련 링크 모음

ITWeb/개발일반 2017. 12. 22. 12:44
:

[Java] Executors 로 간단 multithread 테스트

ITWeb/개발일반 2017. 12. 12. 11:54

이전 글의 참고 문서들을 먼저 보시면 좋습니다.

http://jjeong.tistory.com/1296

package hello.executors;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

public class HelloExecutors {

public static class HelloCallableThread implements Callable<Integer> {
int input;

public HelloCallableThread(int input) {
this.input = input;
}

@Override
public Integer call() throws Exception {
return input + 1;
}
}

public static void main(String[] args) throws Exception {
ExecutorService executorService = Executors.newFixedThreadPool(4);
Set<Callable<Integer>> callables = new HashSet<Callable<Integer>>();

callables.add(new HelloCallableThread(1));
callables.add(new HelloCallableThread(2));
callables.add(new HelloCallableThread(3));
callables.add(new HelloCallableThread(4));

List<Future<Integer>> futures = executorService.invokeAll(callables);

for(Future<Integer> future : futures){
System.out.println("future.get = " + future.get());
}

executorService.shutdown();
executorService.awaitTermination(1, TimeUnit.SECONDS);
}
}


:

[Java] Excutors 에서 제공하는 ExecutorService

ITWeb/개발일반 2017. 11. 24. 15:36

구글링 하기 귀찮아서 소소 코드에 있는 주석이랑 코드 가져 왔습니다.

/**
* Creates a thread pool that reuses a fixed number of threads
* operating off a shared unbounded queue. At any point, at most
* {@code nThreads} threads will be active processing tasks.
* If additional tasks are submitted when all threads are active,
* they will wait in the queue until a thread is available.
* If any thread terminates due to a failure during execution
* prior to shutdown, a new one will take its place if needed to
* execute subsequent tasks. The threads in the pool will exist
* until it is explicitly {@link ExecutorService#shutdown shutdown}.
*
* @param nThreads the number of threads in the pool
* @return the newly created thread pool
* @throws IllegalArgumentException if {@code nThreads <= 0}
*/
public static ExecutorService newFixedThreadPool(int nThreads) {
return new ThreadPoolExecutor(nThreads, nThreads,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>());
}
/**
* Creates a thread pool that maintains enough threads to support
* the given parallelism level, and may use multiple queues to
* reduce contention. The parallelism level corresponds to the
* maximum number of threads actively engaged in, or available to
* engage in, task processing. The actual number of threads may
* grow and shrink dynamically. A work-stealing pool makes no
* guarantees about the order in which submitted tasks are
* executed.
*
* @param parallelism the targeted parallelism level
* @return the newly created thread pool
* @throws IllegalArgumentException if {@code parallelism <= 0}
* @since 1.8
*/
public static ExecutorService newWorkStealingPool(int parallelism) {
return new ForkJoinPool
(parallelism,
ForkJoinPool.defaultForkJoinWorkerThreadFactory,
null, true);
}
/**
* Creates a work-stealing thread pool using all
* {@link Runtime#availableProcessors available processors}
* as its target parallelism level.
* @return the newly created thread pool
* @see #newWorkStealingPool(int)
* @since 1.8
*/
public static ExecutorService newWorkStealingPool() {
return new ForkJoinPool
(Runtime.getRuntime().availableProcessors(),
ForkJoinPool.defaultForkJoinWorkerThreadFactory,
null, true);
}
/**
* Creates a thread pool that reuses a fixed number of threads
* operating off a shared unbounded queue, using the provided
* ThreadFactory to create new threads when needed. At any point,
* at most {@code nThreads} threads will be active processing
* tasks. If additional tasks are submitted when all threads are
* active, they will wait in the queue until a thread is
* available. If any thread terminates due to a failure during
* execution prior to shutdown, a new one will take its place if
* needed to execute subsequent tasks. The threads in the pool will
* exist until it is explicitly {@link ExecutorService#shutdown
* shutdown}.
*
* @param nThreads the number of threads in the pool
* @param threadFactory the factory to use when creating new threads
* @return the newly created thread pool
* @throws NullPointerException if threadFactory is null
* @throws IllegalArgumentException if {@code nThreads <= 0}
*/
public static ExecutorService newFixedThreadPool(int nThreads, ThreadFactory threadFactory) {
return new ThreadPoolExecutor(nThreads, nThreads,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(),
threadFactory);
}
/**
* Creates an Executor that uses a single worker thread operating
* off an unbounded queue. (Note however that if this single
* thread terminates due to a failure during execution prior to
* shutdown, a new one will take its place if needed to execute
* subsequent tasks.) Tasks are guaranteed to execute
* sequentially, and no more than one task will be active at any
* given time. Unlike the otherwise equivalent
* {@code newFixedThreadPool(1)} the returned executor is
* guaranteed not to be reconfigurable to use additional threads.
*
* @return the newly created single-threaded Executor
*/
public static ExecutorService newSingleThreadExecutor() {
return new FinalizableDelegatedExecutorService
(new ThreadPoolExecutor(1, 1,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>()));
}
/**
* Creates an Executor that uses a single worker thread operating
* off an unbounded queue, and uses the provided ThreadFactory to
* create a new thread when needed. Unlike the otherwise
* equivalent {@code newFixedThreadPool(1, threadFactory)} the
* returned executor is guaranteed not to be reconfigurable to use
* additional threads.
*
* @param threadFactory the factory to use when creating new
* threads
*
* @return the newly created single-threaded Executor
* @throws NullPointerException if threadFactory is null
*/
public static ExecutorService newSingleThreadExecutor(ThreadFactory threadFactory) {
return new FinalizableDelegatedExecutorService
(new ThreadPoolExecutor(1, 1,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(),
threadFactory));
}


/**
* Creates a thread pool that creates new threads as needed, but
* will reuse previously constructed threads when they are
* available. These pools will typically improve the performance
* of programs that execute many short-lived asynchronous tasks.
* Calls to {@code execute} will reuse previously constructed
* threads if available. If no existing thread is available, a new
* thread will be created and added to the pool. Threads that have
* not been used for sixty seconds are terminated and removed from
* the cache. Thus, a pool that remains idle for long enough will
* not consume any resources. Note that pools with similar
* properties but different details (for example, timeout parameters)
* may be created using {@link ThreadPoolExecutor} constructors.
*
* @return the newly created thread pool
*/
public static ExecutorService newCachedThreadPool() {
return new ThreadPoolExecutor(0, Integer.MAX_VALUE,
60L, TimeUnit.SECONDS,
new SynchronousQueue<Runnable>());
}
/**
* Creates a thread pool that creates new threads as needed, but
* will reuse previously constructed threads when they are
* available, and uses the provided
* ThreadFactory to create new threads when needed.
* @param threadFactory the factory to use when creating new threads
* @return the newly created thread pool
* @throws NullPointerException if threadFactory is null
*/
public static ExecutorService newCachedThreadPool(ThreadFactory threadFactory) {
return new ThreadPoolExecutor(0, Integer.MAX_VALUE,
60L, TimeUnit.SECONDS,
new SynchronousQueue<Runnable>(),
threadFactory);
}
/**
* Creates a single-threaded executor that can schedule commands
* to run after a given delay, or to execute periodically.
* (Note however that if this single
* thread terminates due to a failure during execution prior to
* shutdown, a new one will take its place if needed to execute
* subsequent tasks.) Tasks are guaranteed to execute
* sequentially, and no more than one task will be active at any
* given time. Unlike the otherwise equivalent
* {@code newScheduledThreadPool(1)} the returned executor is
* guaranteed not to be reconfigurable to use additional threads.
* @return the newly created scheduled executor
*/
public static ScheduledExecutorService newSingleThreadScheduledExecutor() {
return new DelegatedScheduledExecutorService
(new ScheduledThreadPoolExecutor(1));
}
/**
* Creates a single-threaded executor that can schedule commands
* to run after a given delay, or to execute periodically. (Note
* however that if this single thread terminates due to a failure
* during execution prior to shutdown, a new one will take its
* place if needed to execute subsequent tasks.) Tasks are
* guaranteed to execute sequentially, and no more than one task
* will be active at any given time. Unlike the otherwise
* equivalent {@code newScheduledThreadPool(1, threadFactory)}
* the returned executor is guaranteed not to be reconfigurable to
* use additional threads.
* @param threadFactory the factory to use when creating new
* threads
* @return a newly created scheduled executor
* @throws NullPointerException if threadFactory is null
*/
public static ScheduledExecutorService newSingleThreadScheduledExecutor( ThreadFactory threadFactory) {
return new DelegatedScheduledExecutorService
(new ScheduledThreadPoolExecutor(1, threadFactory));
}
/**
* Creates a thread pool that can schedule commands to run after a
* given delay, or to execute periodically.
* @param corePoolSize the number of threads to keep in the pool,
* even if they are idle
* @return a newly created scheduled thread pool
* @throws IllegalArgumentException if {@code corePoolSize < 0}
*/
public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize) {
return new ScheduledThreadPoolExecutor(corePoolSize);
}


/**
* Creates a thread pool that can schedule commands to run after a
* given delay, or to execute periodically.
* @param corePoolSize the number of threads to keep in the pool,
* even if they are idle
* @param threadFactory the factory to use when the executor
* creates a new thread
* @return a newly created scheduled thread pool
* @throws IllegalArgumentException if {@code corePoolSize < 0}
* @throws NullPointerException if threadFactory is null
*/
public static ScheduledExecutorService newScheduledThreadPool(
int corePoolSize, ThreadFactory threadFactory) {
return new ScheduledThreadPoolExecutor(corePoolSize, threadFactory);
}
/**
* Returns an object that delegates all defined {@link
* ExecutorService} methods to the given executor, but not any
* other methods that might otherwise be accessible using
* casts. This provides a way to safely "freeze" configuration and
* disallow tuning of a given concrete implementation.
* @param executor the underlying implementation
* @return an {@code ExecutorService} instance
* @throws NullPointerException if executor null
*/
public static ExecutorService unconfigurableExecutorService(ExecutorService executor) {
if (executor == null)
throw new NullPointerException();
return new DelegatedExecutorService(executor);
}
/**
* Returns an object that delegates all defined {@link
* ScheduledExecutorService} methods to the given executor, but
* not any other methods that might otherwise be accessible using
* casts. This provides a way to safely "freeze" configuration and
* disallow tuning of a given concrete implementation.
* @param executor the underlying implementation
* @return a {@code ScheduledExecutorService} instance
* @throws NullPointerException if executor null
*/
public static ScheduledExecutorService unconfigurableScheduledExecutorService( ScheduledExecutorService executor) {
if (executor == null)
throw new NullPointerException();
return new DelegatedScheduledExecutorService(executor);
}


  • newFixedThreadPool
    • 정해준 크기 만큼의 쓰레드를 생성하고 재사용 합니다. 명시적으로 shutdown() 하지 않는 한 쓰레드 중 하나가 종료 되면 다시 생성을 하게 됩니다.


  • newWorkStealingPool
    • 작업 순서에 대한 보장은 하지 않습니다, parallelism 수준에 따라 쓰레드를 충분히 지원 하지만 다중큐를 사용하는 것이 좋습니다. 쓰레드의 크기는 동적으로 늘었다 줄었다 합니다.


  • newSingleThreadExecutor
    • 쓰레드를 하나만 생성해서 사용합니다. 만약 종료 되면 다시 쓰레드가 생성이 되며 작업에 대한 연속성을 보장해 줍니다.


  • newCachedThreadPool
    • 필요한 만큼 쓰레드를 생성 하게 됩니다. 하지만 60초 동안 사용되지 않으면 풀에서 제거 됩니다.
    • 60초가 기본 설정 값 이며, 생성된 쓰레드는 재사용 됩니다.


  • newSingleThreadScheduledExecutor
    • 스케쥴링이 가능한 하나의 쓰레드를 생성 합니다. 스케쥴 기능을 빼고는 newSingleThreadExecutor 와 비슷 하다고 보시면 됩니다.


  • newScheduledThreadPool
    • 스케쥴링이 가능한 쓰레드 풀을 생성 합니다. 쓰레드가 idle 상태에 있더라도 종료 되거나 소멸 되지 않고 풀에 그대로 남아 있습니다.


:

[Java] java.util.concurrent 관련 예제

ITWeb/개발일반 2017. 11. 24. 15:03

구글링 하기 귀찮을 땐.

http://tutorials.jenkov.com/java-util-concurrent/index.html

http://winterbe.com/posts/2015/04/07/java8-concurrency-tutorial-thread-executor-examples/


그리고 java 8 관련해서는 위에 링크 중 아래 블로그 쥔장이 잘 정리해 둔것 같내요.

http://winterbe.com/java/

:

[Java] Array Value 존재 유무 확인하기

ITWeb/개발일반 2017. 4. 18. 10:38

생각 나지 않을때가 많아서 퍼왔습니다.


Originanl Source)

http://www.programcreek.com/2014/04/check-if-array-contains-a-value-java/


public static boolean useList(String[] arr, String targetValue) {

  return Arrays.asList(arr).contains(targetValue);

}


public static boolean useSet(String[] arr, String targetValue) {

  Set<String> set = new HashSet<String>(Arrays.asList(arr));

  return set.contains(targetValue);

}


public static boolean useLoop(String[] arr, String targetValue) {

  for(String s: arr){

    if(s.equals(targetValue))

      return true;

  }

  return false;

}


public static boolean useArraysBinarySearch(String[] arr, String targetValue) { 

  int a =  Arrays.binarySearch(arr, targetValue);

  if(a > 0)

    return true;

  else

    return false;

}


binary search 가 제일 성능이 좋습니다.

단, 위 코드에서 빠진게 있다면 Arrays.sort(arr) 를 먼저 하고 하셔야 된다는 것입니다.


Arrays.sort(arr);

int a = Arrays.binarySearch(arr, targetValue);

:

[Gradle] Gradle project 맛보기.

ITWeb/개발일반 2017. 1. 9. 13:46

Intellij 를 이용한 gradle project 를 생성하는 아주 초보적인 내용입니다.

개인적인 생각으로는 single project 이고 maven 에 익숙하시면 그냥 maven project 로 개발 하시는게 편하실 수 있습니다.


Step 0)

- Gradle 설치가 되어 있어야 합니다.

- Java 설치가 되어 있어야 합니다.

- Path 설정이 되어 있어야 합니다.


Step 1)

New -> Project -> Gradle 선택을 하시면 됩니다.


Step 2)

maven project 생성 할 때와 동일하게 GroupId, ArtifactId, Version 정보를 등록 하면 됩니다.


Next 버튼을 누르고 누르고 나면 기본 Gradle Project 가 생성이 됩니다.


Step 3) build.gradle & settings.gradle

기본적인 빌드 환경과 정보들을 작성 하게 됩니다.

maven 의 pom.xml 과 비슷하다고 보시면 될 것 같습니다.


Step 4) module 추가하기

해당 프로젝트에서 new -> module 하시면 됩니다.

동일하게 gradle project 으로 해서 추가했습니다.


Step 5) 기본 java application directory 생성

src/main/java

src/main/resources

src/test/java

src/test/resources


Step 6) Java main class 생성

public class HelloWorld {

public static void main (String[] args) {
System.out.println("Hello World!!");
}
}


Step 7) Build & Run

$ gradle build


$ java -jar ./helloworld/build/libs/helloworld-1.0-SNAPSHOT.jar HelloWorld

./helloworld/build/libs/helloworld-1.0-SNAPSHOT.jar에 기본 Manifest 속성이 없습니다.


# manifest 속성을 선언 안해서 그렇습니다.
해당 프로젝트의 build.gradle 에 선언 하면 됩니다.
excutable jar 생성 하는 거랑 같은 거라고 보시면 됩니다.
jar {
manifest {
attributes 'Main-Class': 'org.jjeong93.hello.HelloWorld'
}
}

$ java -jar ./helloworld/build/libs/helloworld-1.0-SNAPSHOT.jar HelloWorld

Hello World!!


일반적인 Java application 만드는 걸 예제로 보여 드렸습니다.
저는 기존 maven project 를 gradle multi project 로 마이그레이션 하려고 합니다.
dependency 설정 하는 번거로움이 좀 있기는 하지만 마이그레이션 방법을 제공 하고 있으니 참고 하면 될 것 같습니다.

[참고문서]


: